(function($){
'use strict';
if(typeof wpcf7==='undefined'||wpcf7===null){
return;
}
wpcf7=$.extend({
cached: 0,
inputs: []
}, wpcf7);
$(function(){
wpcf7.supportHtml5=(function(){
var features={};
var input=document.createElement('input');
features.placeholder='placeholder' in input;
var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ];
$.each(inputTypes, function(index, value){
input.setAttribute('type', value);
features[ value ]=input.type!=='text';
});
return features;
})();
$('div.wpcf7 > form').each(function(){
var $form=$(this);
wpcf7.initForm($form);
if(wpcf7.cached){
wpcf7.refill($form);
}});
});
wpcf7.getId=function(form){
return parseInt($('input[name="_wpcf7"]', form).val(), 10);
};
wpcf7.initForm=function(form){
var $form=$(form);
wpcf7.setStatus($form, 'init');
$form.submit(function(event){
if(! wpcf7.supportHtml5.placeholder){
$('[placeholder].placeheld', $form).each(function(i, n){
$(n).val('').removeClass('placeheld');
});
}
if(typeof window.FormData==='function'){
wpcf7.submit($form);
event.preventDefault();
}});
$('.wpcf7-submit', $form).after(' ');
wpcf7.toggleSubmit($form);
$form.on('click', '.wpcf7-acceptance', function(){
wpcf7.toggleSubmit($form);
});
$('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){
var name=$(this).attr('name');
$form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false);
});
$('.wpcf7-list-item.has-free-text', $form).each(function(){
var $freetext=$(':input.wpcf7-free-text', this);
var $wrap=$(this).closest('.wpcf7-form-control');
if($(':checkbox, :radio', this).is(':checked')){
$freetext.prop('disabled', false);
}else{
$freetext.prop('disabled', true);
}
$wrap.on('change', ':checkbox, :radio', function(){
var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio');
if($cb.is(':checked')){
$freetext.prop('disabled', false).focus();
}else{
$freetext.prop('disabled', true);
}});
});
if(! wpcf7.supportHtml5.placeholder){
$('[placeholder]', $form).each(function(){
$(this).val($(this).attr('placeholder'));
$(this).addClass('placeheld');
$(this).focus(function(){
if($(this).hasClass('placeheld')){
$(this).val('').removeClass('placeheld');
}});
$(this).blur(function(){
if(''===$(this).val()){
$(this).val($(this).attr('placeholder'));
$(this).addClass('placeheld');
}});
});
}
if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){
$form.find('input.wpcf7-date[type="date"]').each(function(){
$(this).datepicker({
dateFormat: 'yy-mm-dd',
minDate: new Date($(this).attr('min')),
maxDate: new Date($(this).attr('max'))
});
});
}
if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){
$form.find('input.wpcf7-number[type="number"]').each(function(){
$(this).spinner({
min: $(this).attr('min'),
max: $(this).attr('max'),
step: $(this).attr('step')
});
});
}
wpcf7.resetCounter($form);
$form.on('change', '.wpcf7-validates-as-url', function(){
var val=$.trim($(this).val());
if(val
&& ! val.match(/^[a-z][a-z0-9.+-]*:/i)
&& -1!==val.indexOf('.')){
val=val.replace(/^\/+/, '');
val='http://' + val;
}
$(this).val(val);
});
};
wpcf7.submit=function(form){
if(typeof window.FormData!=='function'){
return;
}
var $form=$(form);
$('.ajax-loader', $form).addClass('is-active');
wpcf7.clearResponse($form);
var formData=new FormData($form.get(0));
var detail={
id: $form.closest('div.wpcf7').attr('id'),
status: 'init',
inputs: [],
formData: formData
};
$.each($form.serializeArray(), function(i, field){
if('_wpcf7'==field.name){
detail.contactFormId=field.value;
}else if('_wpcf7_version'==field.name){
detail.pluginVersion=field.value;
}else if('_wpcf7_locale'==field.name){
detail.contactFormLocale=field.value;
}else if('_wpcf7_unit_tag'==field.name){
detail.unitTag=field.value;
}else if('_wpcf7_container_post'==field.name){
detail.containerPostId=field.value;
}else if(field.name.match(/^_/)){
}else{
detail.inputs.push(field);
}});
wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail);
var ajaxSuccess=function(data, status, xhr, $form){
detail.id=$(data.into).attr('id');
detail.status=data.status;
detail.apiResponse=data;
switch(data.status){
case 'init':
wpcf7.setStatus($form, 'init');
break;
case 'validation_failed':
$.each(data.invalid_fields, function(i, n){
$(n.into, $form).each(function(){
wpcf7.notValidTip(this, n.message);
$('.wpcf7-form-control', this).addClass('wpcf7-not-valid');
$('.wpcf7-form-control', this).attr('aria-describedby',
n.error_id
);
$('[aria-invalid]', this).attr('aria-invalid', 'true');
});
});
wpcf7.setStatus($form, 'invalid');
wpcf7.triggerEvent(data.into, 'invalid', detail);
break;
case 'acceptance_missing':
wpcf7.setStatus($form, 'unaccepted');
wpcf7.triggerEvent(data.into, 'unaccepted', detail);
break;
case 'spam':
wpcf7.setStatus($form, 'spam');
wpcf7.triggerEvent(data.into, 'spam', detail);
break;
case 'aborted':
wpcf7.setStatus($form, 'aborted');
wpcf7.triggerEvent(data.into, 'aborted', detail);
break;
case 'mail_sent':
wpcf7.setStatus($form, 'sent');
wpcf7.triggerEvent(data.into, 'mailsent', detail);
break;
case 'mail_failed':
wpcf7.setStatus($form, 'failed');
wpcf7.triggerEvent(data.into, 'mailfailed', detail);
break;
default:
wpcf7.setStatus($form,
'custom-' + data.status.replace(/[^0-9a-z]+/i, '-')
);
}
wpcf7.refill($form, data);
wpcf7.triggerEvent(data.into, 'submit', detail);
if('mail_sent'==data.status){
$form.each(function(){
this.reset();
});
wpcf7.toggleSubmit($form);
wpcf7.resetCounter($form);
}
if(! wpcf7.supportHtml5.placeholder){
$form.find('[placeholder].placeheld').each(function(i, n){
$(n).val($(n).attr('placeholder'));
});
}
$('.wpcf7-response-output', $form)
.html('').append(data.message).slideDown('fast');
$('.screen-reader-response', $form.closest('.wpcf7')).each(function(){
var $response=$(this);
$('[role="status"]', $response).html(data.message);
if(data.invalid_fields){
$.each(data.invalid_fields, function(i, n){
if(n.idref){
var $li=$('
').append($(' ').attr('href', '#' + n.idref).append(n.message));
}else{
var $li=$(' ').append(n.message);
}
$li.attr('id', n.error_id);
$('ul', $response).append($li);
});
}});
if(data.posted_data_hash){
$form.find('input[name="_wpcf7_posted_data_hash"]').first()
.val(data.posted_data_hash);
}};
$.ajax({
type: 'POST',
url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'),
data: formData,
dataType: 'json',
processData: false,
contentType: false
}).done(function(data, status, xhr){
ajaxSuccess(data, status, xhr, $form);
$('.ajax-loader', $form).removeClass('is-active');
}).fail(function(xhr, status, error){
var $e=$('
').text(error.message);
$form.after($e);
});
};
wpcf7.triggerEvent=function(target, name, detail){
var event=new CustomEvent('wpcf7' + name, {
bubbles: true,
detail: detail
});
$(target).get(0).dispatchEvent(event);
};
wpcf7.setStatus=function(form, status){
var $form=$(form);
var prevStatus=$form.attr('data-status');
$form.data('status', status);
$form.addClass(status);
$form.attr('data-status', status);
if(prevStatus&&prevStatus!==status){
$form.removeClass(prevStatus);
}}
wpcf7.toggleSubmit=function(form, state){
var $form=$(form);
var $submit=$('input:submit', $form);
if(typeof state!=='undefined'){
$submit.prop('disabled', ! state);
return;
}
if($form.hasClass('wpcf7-acceptance-as-validation')){
return;
}
$submit.prop('disabled', false);
$('.wpcf7-acceptance', $form).each(function(){
var $span=$(this);
var $input=$('input:checkbox', $span);
if(! $span.hasClass('optional')){
if($span.hasClass('invert')&&$input.is(':checked')
|| ! $span.hasClass('invert')&&! $input.is(':checked')){
$submit.prop('disabled', true);
return false;
}}
});
};
wpcf7.resetCounter=function(form){
var $form=$(form);
$('.wpcf7-character-count', $form).each(function(){
var $count=$(this);
var name=$count.attr('data-target-name');
var down=$count.hasClass('down');
var starting=parseInt($count.attr('data-starting-value'), 10);
var maximum=parseInt($count.attr('data-maximum-value'), 10);
var minimum=parseInt($count.attr('data-minimum-value'), 10);
var updateCount=function(target){
var $target=$(target);
var length=$target.val().length;
var count=down ? starting - length:length;
$count.attr('data-current-value', count);
$count.text(count);
if(maximum&&maximum < length){
$count.addClass('too-long');
}else{
$count.removeClass('too-long');
}
if(minimum&&length < minimum){
$count.addClass('too-short');
}else{
$count.removeClass('too-short');
}};
$(':input[name="' + name + '"]', $form).each(function(){
updateCount(this);
$(this).keyup(function(){
updateCount(this);
});
});
});
};
wpcf7.notValidTip=function(target, message){
var $target=$(target);
$('.wpcf7-not-valid-tip', $target).remove();
$(' ').attr({
'class': 'wpcf7-not-valid-tip',
'aria-hidden': 'true',
}).text(message).appendTo($target);
if($target.is('.use-floating-validation-tip *')){
var fadeOut=function(target){
$(target).not(':hidden').animate({
opacity: 0
}, 'fast', function(){
$(this).css({ 'z-index': -100 });
});
};
$target.on('mouseover', '.wpcf7-not-valid-tip', function(){
fadeOut(this);
});
$target.on('focus', ':input', function(){
fadeOut($('.wpcf7-not-valid-tip', $target));
});
}};
wpcf7.refill=function(form, data){
var $form=$(form);
var refillCaptcha=function($form, items){
$.each(items, function(i, n){
$form.find(':input[name="' + i + '"]').val('');
$form.find('img.wpcf7-captcha-' + i).attr('src', n);
var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n);
$form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]);
});
};
var refillQuiz=function($form, items){
$.each(items, function(i, n){
$form.find(':input[name="' + i + '"]').val('');
$form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]);
$form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]);
});
};
if(typeof data==='undefined'){
$.ajax({
type: 'GET',
url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'),
beforeSend: function(xhr){
var nonce=$form.find(':input[name="_wpnonce"]').val();
if(nonce){
xhr.setRequestHeader('X-WP-Nonce', nonce);
}},
dataType: 'json'
}).done(function(data, status, xhr){
if(data.captcha){
refillCaptcha($form, data.captcha);
}
if(data.quiz){
refillQuiz($form, data.quiz);
}});
}else{
if(data.captcha){
refillCaptcha($form, data.captcha);
}
if(data.quiz){
refillQuiz($form, data.quiz);
}}
};
wpcf7.clearResponse=function(form){
var $form=$(form);
$form.siblings('.screen-reader-response').each(function(){
$('[role="status"]', this).html('');
$('ul', this).html('');
});
$('.wpcf7-not-valid-tip', $form).remove();
$('[aria-invalid]', $form).attr('aria-invalid', 'false');
$('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid');
$('.wpcf7-response-output', $form).hide().empty();
};
wpcf7.apiSettings.getRoute=function(path){
var url=wpcf7.apiSettings.root;
url=url.replace(wpcf7.apiSettings.namespace,
wpcf7.apiSettings.namespace + path);
return url;
};})(jQuery);
(function (){
if(typeof window.CustomEvent==="function") return false;
function CustomEvent(event, params){
params=params||{ bubbles: false, cancelable: false, detail: undefined };
var evt=document.createEvent('CustomEvent');
evt.initCustomEvent(event,
params.bubbles, params.cancelable, params.detail);
return evt;
}
CustomEvent.prototype=window.Event.prototype;
window.CustomEvent=CustomEvent;
})();
if(typeof TRX_UTILS_STORAGE=='undefined') var TRX_UTILS_STORAGE={};
jQuery(document).ready(function(){
"use strict";
jQuery('.popup_form.login_form').submit(function(e){
"use strict";
var rez=trx_utils_login_validate(jQuery(this));
if(!rez)
e.preventDefault();
return rez;
});
jQuery('.popup_form.registration_form').submit(function(e){
"use strict";
var rez=trx_utils_registration_validate(jQuery(this));
if(!rez)
e.preventDefault();
return rez;
});
jQuery("form#commentform").submit(function(e){
"use strict";
var rez=trx_utils_comments_validate(jQuery(this));
if(!rez)
e.preventDefault();
return rez;
});
});
function trx_utils_form_validate(form, opt){
"use strict";
var error_msg='';
form.find(":input").each(function(){
"use strict";
if(error_msg!=''&&opt.exit_after_first_error) return;
for (var i=0; i < opt.rules.length; i++){
if(jQuery(this).attr("name")==opt.rules[i].field){
var val=jQuery(this).val();
var error=false;
if(typeof(opt.rules[i].min_length)=='object'){
if(opt.rules[i].min_length.value > 0&&val.length < opt.rules[i].min_length.value){
if(error_msg=='') jQuery(this).get(0).focus();
error_msg +='' + (typeof(opt.rules[i].min_length.message)!='undefined' ? opt.rules[i].min_length.message:opt.error_message_text) + '
'
error=true;
}}
if((!error||!opt.exit_after_first_error)&&typeof(opt.rules[i].max_length)=='object'){
if(opt.rules[i].max_length.value > 0&&val.length > opt.rules[i].max_length.value){
if(error_msg=='') jQuery(this).get(0).focus();
error_msg +='' + (typeof(opt.rules[i].max_length.message)!='undefined' ? opt.rules[i].max_length.message:opt.error_message_text) + '
'
error=true;
}}
if((!error||!opt.exit_after_first_error)&&typeof(opt.rules[i].mask)=='object'){
if(val.length > 0&&opt.rules[i].mask.value!=''){
var regexp=new RegExp(opt.rules[i].mask.value);
if(!regexp.test(val)){
if(error_msg=='') jQuery(this).get(0).focus();
error_msg +='' + (typeof(opt.rules[i].mask.message)!='undefined' ? opt.rules[i].mask.message:opt.error_message_text) + '
'
error=true;
}}
}
if((!error||!opt.exit_after_first_error)&&typeof(opt.rules[i].state)=='object'){
if(opt.rules[i].state.value=='checked'&&!jQuery(this).get(0).checked){
if(error_msg=='') jQuery(this).get(0).focus();
error_msg +='' + (typeof(opt.rules[i].state.message)!='undefined' ? opt.rules[i].state.message:opt.error_message_text) + '
'
error=true;
}}
if((!error||!opt.exit_after_first_error)&&typeof(opt.rules[i].equal_to)=='object'){
if(opt.rules[i].equal_to.value!=''&&val!=jQuery(jQuery(this).get(0).form[opt.rules[i].equal_to.value]).val()){
if(error_msg=='') jQuery(this).get(0).focus();
error_msg +='' + (typeof(opt.rules[i].equal_to.message)!='undefined' ? opt.rules[i].equal_to.message:opt.error_message_text) + '
'
error=true;
}}
if(opt.error_fields_class!='') jQuery(this).toggleClass(opt.error_fields_class, error);
}}
});
if(error_msg!=''&&opt.error_message_show){
var error_message_box=form.find(".result");
if(error_message_box.length==0) error_message_box=form.parent().find(".result");
if(error_message_box.length==0){
form.append('
');
error_message_box=form.find(".result");
}
if(opt.error_message_class) error_message_box.toggleClass(opt.error_message_class, true);
error_message_box.html(error_msg).fadeIn();
setTimeout(function(){ error_message_box.fadeOut(); }, opt.error_message_time);
}
return error_msg!='';
}
function trx_utils_comments_validate(form){
"use strict";
form.find('input').removeClass('error_fields_class');
var rules={
error_message_text: TRX_UTILS_STORAGE['msg_error_global'],
error_message_show: true,
error_message_time: 4000,
error_message_class: 'sc_infobox sc_infobox_style_error',
error_fields_class: 'error_fields_class',
exit_after_first_error: false,
rules: [
{
field: 'comment',
min_length: { value: 1, message: TRX_UTILS_STORAGE['msg_text_empty'] },
max_length: { value: TRX_UTILS_STORAGE['comments_maxlength'], message: TRX_UTILS_STORAGE['msg_text_long']}}
]
};
if(form.find('.comments_author input[aria-required="true"]').length > 0){
rules.rules.push({
field: 'author',
min_length: { value: 1, message: TRX_UTILS_STORAGE['msg_name_empty']},
max_length: { value: 60, message: TRX_UTILS_STORAGE['msg_name_long']}}
);
}
if(form.find('.comments_email input[aria-required="true"]').length > 0){
rules.rules.push({
field: 'email',
min_length: { value: 7, message: TRX_UTILS_STORAGE['msg_email_empty']},
max_length: { value: 60, message: TRX_UTILS_STORAGE['msg_email_long']},
mask: { value: TRX_UTILS_STORAGE['email_mask'], message: TRX_UTILS_STORAGE['msg_email_not_valid']}}
);
}
var error=trx_utils_form_validate(form, rules);
return !error;
}
function trx_utils_login_validate(form){
"use strict";
form.find('input').removeClass('error_fields_class');
var error=trx_utils_form_validate(form, {
error_message_show: true,
error_message_time: 4000,
error_message_class: 'sc_infobox sc_infobox_style_error',
error_fields_class: 'error_fields_class',
exit_after_first_error: true,
rules: [
{
field: "log",
min_length: { value: 1, message: TRX_UTILS_STORAGE['msg_login_empty'] },
max_length: { value: 60, message: TRX_UTILS_STORAGE['msg_login_long'] }},
{
field: "pwd",
min_length: { value: 4, message: TRX_UTILS_STORAGE['msg_password_empty'] },
max_length: { value: 30, message: TRX_UTILS_STORAGE['msg_password_long'] }}
]
});
if(TRX_UTILS_STORAGE['login_via_ajax']&&!error){
jQuery.post(TRX_UTILS_STORAGE['ajax_url'], {
action: 'trx_utils_login_user',
nonce: TRX_UTILS_STORAGE['ajax_nonce'],
remember: form.find('#rememberme').val(),
user_log: form.find('#log').val(),
user_pwd: form.find('#password').val()
}).done(function(response){
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: TRX_UTILS_STORAGE['ajax_error'] };
console.log(response);
}
var result_box=form.find('.result');
if(result_box.length==0) result_box=form.siblings('.result');
if(result_box.length==0) result_box=form.after('
').next('.result');
result_box.toggleClass('sc_infobox_style_error', false).toggleClass('sc_infobox_style_success', false);
if(rez.error===''){
result_box.addClass('sc_infobox sc_infobox_style_success').html(TRX_UTILS_STORAGE['msg_login_success']);
setTimeout(function(){
location.reload();
}, 3000);
}else{
result_box.addClass('sc_infobox sc_infobox_style_error').html(TRX_UTILS_STORAGE['msg_login_failed'] + ' ' + rez.error);
}
result_box.fadeIn().delay(3000).fadeOut();
});
}
return !TRX_UTILS_STORAGE['login_via_ajax']&&!error;
}
function trx_utils_registration_validate(form){
"use strict";
form.find('input').removeClass('error_fields_class');
var error=trx_utils_form_validate(form, {
error_message_show: true,
error_message_time: 4000,
error_message_class: "sc_infobox sc_infobox_style_error",
error_fields_class: "error_fields_class",
exit_after_first_error: true,
rules: [
{
field: "registration_agree",
state: { value: 'checked', message: TRX_UTILS_STORAGE['msg_not_agree'] },
},
{
field: "registration_username",
min_length: { value: 1, message: TRX_UTILS_STORAGE['msg_login_empty'] },
max_length: { value: 60, message: TRX_UTILS_STORAGE['msg_login_long'] }},
{
field: "registration_email",
min_length: { value: 7, message: TRX_UTILS_STORAGE['msg_email_empty'] },
max_length: { value: 60, message: TRX_UTILS_STORAGE['msg_email_long'] },
mask: { value: TRX_UTILS_STORAGE['email_mask'], message: TRX_UTILS_STORAGE['msg_email_not_valid'] }},
{
field: "registration_pwd",
min_length: { value: 4, message: TRX_UTILS_STORAGE['msg_password_empty'] },
max_length: { value: 30, message: TRX_UTILS_STORAGE['msg_password_long'] }},
{
field: "registration_pwd2",
equal_to: { value: 'registration_pwd', message: TRX_UTILS_STORAGE['msg_password_not_equal'] }}
]
});
if(!error){
jQuery.post(TRX_UTILS_STORAGE['ajax_url'], {
action: 'trx_utils_registration_user',
nonce: TRX_UTILS_STORAGE['ajax_nonce'],
user_name: form.find('#registration_username').val(),
user_email: form.find('#registration_email').val(),
user_pwd: form.find('#registration_pwd').val()
}).done(function(response){
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: TRX_UTILS_STORAGE['ajax_error'] };
console.log(response);
}
var result_box=form.find('.result');
if(result_box.length==0) result_box=form.siblings('.result');
if(result_box.length==0) result_box=form.after('
').next('.result');
result_box.toggleClass('sc_infobox_style_error', false).toggleClass('sc_infobox_style_success', false);
if(rez.error===''){
result_box.addClass('sc_infobox sc_infobox_style_success').html(TRX_UTILS_STORAGE['msg_registration_success']);
setTimeout(function(){
jQuery('.popup_login_link').trigger('click');
}, 3000);
}else{
result_box.addClass('sc_infobox sc_infobox_style_error').html(TRX_UTILS_STORAGE['msg_registration_failed'] + ' ' + rez.error);
}
result_box.fadeIn().delay(3000).fadeOut();
});
}
return false;
};
;(function ($){
"use strict";
var methods=(function (){
var c={
bcClass: 'sf-breadcrumb',
menuClass: 'sf-js-enabled',
anchorClass: 'sf-with-ul',
menuArrowClass: 'sf-arrows'
},
ios=(function (){
var ios=/iPhone|iPad|iPod/i.test(navigator.userAgent);
if(ios){
$(window).load(function (){
$('body').children().on('click', $.noop);
});
}
return ios;
})(),
wp7=(function (){
var style=document.documentElement.style;
return ('behavior' in style&&'fill' in style&&/iemobile/i.test(navigator.userAgent));
})(),
toggleMenuClasses=function ($menu, o){
var classes=c.menuClass;
if(o.cssArrows){
classes +=' ' + c.menuArrowClass;
}
$menu.toggleClass(classes);
},
setPathToCurrent=function ($menu, o){
return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels)
.addClass(o.hoverClass + ' ' + c.bcClass)
.filter(function (){
return ($(this).children(o.popUpSelector).hide().show().length);
}).removeClass(o.pathClass);
},
toggleAnchorClass=function ($li){
$li.children('a').toggleClass(c.anchorClass);
},
toggleTouchAction=function ($menu){
var touchAction=$menu.css('ms-touch-action');
touchAction=(touchAction==='pan-y') ? 'auto':'pan-y';
$menu.css('ms-touch-action', touchAction);
},
applyHandlers=function ($menu, o){
var targets='li:has(' + o.popUpSelector + ')';
if($.fn.hoverIntent&&!o.disableHI){
$menu.hoverIntent(over, out, targets);
}else{
$menu
.on('mouseenter.superfish', targets, over)
.on('mouseleave.superfish', targets, out);
}
var touchevent='MSPointerDown.superfish';
if(!ios){
touchevent +=' touchend.superfish';
}
if(wp7){
touchevent +=' mousedown.superfish';
}
$menu
.on('focusin.superfish', 'li', over)
.on('focusout.superfish', 'li', out)
.on(touchevent, 'a', o, touchHandler);
},
touchHandler=function (e){
var $this=$(this),
$ul=$this.siblings(e.data.popUpSelector);
if($ul.length > 0&&$ul.is(':hidden')){
$this.one('click.superfish', false);
if(e.type==='MSPointerDown'){
$this.trigger('focus');
}else{
$.proxy(over, $this.parent('li'))();
}}
},
over=function (){
var $this=$(this),
o=getOptions($this);
clearTimeout(o.sfTimer);
$this.siblings().superfish('hide').end().superfish('show');
},
out=function (){
var $this=$(this),
o=getOptions($this);
if(ios){
$.proxy(close, $this, o)();
}else{
clearTimeout(o.sfTimer);
o.sfTimer=setTimeout($.proxy(close, $this, o), o.delay);
}},
close=function (o){
o.retainPath=($.inArray(this[0], o.$path) > -1);
this.superfish('hide');
if(!this.parents('.' + o.hoverClass).length){
o.onIdle.call(getMenu(this));
if(o.$path.length){
$.proxy(over, o.$path)();
}}
},
getMenu=function ($el){
return $el.closest('.' + c.menuClass);
},
getOptions=function ($el){
return getMenu($el).data('sf-options');
};
return {
hide: function (instant){
if(this.length){
var $this=this,
o=getOptions($this);
if(!o){
return this;
}
var not=(o.retainPath===true) ? o.$path:'',
$ul=$this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector),
speed=o.speedOut;
if(instant){
$ul.show();
speed=0;
}
o.retainPath=false;
o.onBeforeHide.call($ul);
$ul.stop(true, true).animate(o.animationOut, speed, function (){
var $this=$(this);
o.onHide.call($this);
});
}
return this;
},
show: function (){
var o=getOptions(this);
if(!o){
return this;
}
var $this=this.addClass(o.hoverClass),
$ul=$this.children(o.popUpSelector);
o.onBeforeShow.call($ul);
$ul.stop(true, true).animate(o.animation, o.speed, function (){
o.onShow.call($ul);
});
return this;
},
destroy: function (){
return this.each(function (){
var $this=$(this),
o=$this.data('sf-options'),
$hasPopUp;
if(!o){
return false;
}
$hasPopUp=$this.find(o.popUpSelector).parent('li');
clearTimeout(o.sfTimer);
toggleMenuClasses($this, o);
toggleAnchorClass($hasPopUp);
toggleTouchAction($this);
$this.off('.superfish').off('.hoverIntent');
$hasPopUp.children(o.popUpSelector).attr('style', function (i, style){
return style.replace(/display[^;]+;?/g, '');
});
o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass);
$this.find('.' + o.hoverClass).removeClass(o.hoverClass);
o.onDestroy.call($this);
$this.removeData('sf-options');
});
},
init: function (op){
return this.each(function (){
var $this=$(this);
if($this.data('sf-options')){
return false;
}
var o=$.extend({}, $.fn.superfish.defaults, op),
$hasPopUp=$this.find(o.popUpSelector).parent('li');
o.$path=setPathToCurrent($this, o);
$this.data('sf-options', o);
toggleMenuClasses($this, o);
toggleAnchorClass($hasPopUp);
toggleTouchAction($this);
applyHandlers($this, o);
$hasPopUp.not('.' + c.bcClass).superfish('hide', true);
o.onInit.call(this);
});
}};})();
$.fn.superfish=function (method, args){
if(methods[method]){
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}
else if(typeof method==='object'||! method){
return methods.init.apply(this, arguments);
}else{
return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish');
}};
$.fn.superfish.defaults={
popUpSelector: 'ul,.sf-mega',
hoverClass: 'sfHover',
pathClass: 'overrideThisToUse',
pathLevels: 1,
delay: 800,
animation: {opacity: 'show'},
animationOut: {opacity: 'hide'},
speed: 'normal',
speedOut: 'fast',
cssArrows: true,
disableHI: false,
onInit: $.noop,
onBeforeShow: $.noop,
onShow: $.noop,
onBeforeHide: $.noop,
onHide: $.noop,
onIdle: $.noop,
onDestroy: $.noop
};
$.fn.extend({
hideSuperfishUl: methods.hide,
showSuperfishUl: methods.show
});
})(jQuery);
if(typeof JUNOTOYS_STORAGE=='undefined') var JUNOTOYS_STORAGE={};
function junotoys_storage_get(var_name){
"use strict";
return junotoys_isset(JUNOTOYS_STORAGE[var_name]) ? JUNOTOYS_STORAGE[var_name]:'';
}
function junotoys_storage_set(var_name, value){
"use strict";
JUNOTOYS_STORAGE[var_name]=value;
}
function junotoys_storage_inc(var_name){
"use strict";
var value=arguments[1]==undefined ? 1:arguments[1];
JUNOTOYS_STORAGE[var_name] +=value;
}
function junotoys_storage_concat(var_name, value){
"use strict";
JUNOTOYS_STORAGE[var_name] +=''+value;
}
function junotoys_storage_get_array(var_name, key){
"use strict";
return junotoys_isset(JUNOTOYS_STORAGE[var_name][key]) ? JUNOTOYS_STORAGE[var_name][key]:'';
}
function junotoys_storage_set_array(var_name, key, value){
"use strict";
if(!junotoys_isset(JUNOTOYS_STORAGE[var_name])) JUNOTOYS_STORAGE[var_name]={};
JUNOTOYS_STORAGE[var_name][key]=value;
}
function junotoys_storage_inc_array(var_name, key){
"use strict";
var value=arguments[2]==undefined ? 1:arguments[2];
JUNOTOYS_STORAGE[var_name][key] +=value;
}
function junotoys_storage_concat_array(var_name, key, value){
"use strict";
JUNOTOYS_STORAGE[var_name][key] +=''+value;
}
function junotoys_isset(obj){
"use strict";
return typeof(obj)!='undefined';
}
function junotoys_empty(obj){
"use strict";
return typeof(obj)=='undefined'||(typeof(obj)=='object'&&obj==null)||(typeof(obj)=='array'&&obj.length==0)||(typeof(obj)=='string'&&junotoys_alltrim(obj)=='')||obj===0;
}
function junotoys_is_array(obj){
"use strict";
return typeof(obj)=='array';
}
function junotoys_is_object(obj){
"use strict";
return typeof(obj)=='object';
}
function junotoys_clone_object(obj){
"use strict";
if(obj==null||typeof(obj)!='object'){
return obj;
}
var temp={};
for (var key in obj){
temp[key]=junotoys_clone_object(obj[key]);
}
return temp;
}
function junotoys_merge_objects(obj1, obj2){
"use strict";
for (var i in obj2)
if(obj2.hasOwnProperty(i))
obj1[i]=obj2[i];
return obj1;
}
function junotoys_serialize(mixed_val){
"use strict";
var obj_to_array=arguments.length==1||argument[1]===true;
switch (typeof(mixed_val)){
case "number":
if(isNaN(mixed_val)||!isFinite(mixed_val))
return false;
else
return (Math.floor(mixed_val)==mixed_val ? "i":"d") + ":" + mixed_val + ";";
case "string":
return "s:" + mixed_val.length + ":\"" + mixed_val + "\";";
case "boolean":
return "b:" + (mixed_val ? "1":"0") + ";";
case "object":
if(mixed_val==null)
return "N;";
else if(mixed_val instanceof Array){
var idxobj={ idx: -1 };
var map=[];
for (var i=0; i=0; i--){
if(str.substr(i,1)!=' '){
end=i;
break;
}}
}
return str.substring(start, end+1);
}
function junotoys_ltrim(str){
"use strict";
return junotoys_alltrim(str, 'l');
}
function junotoys_rtrim(str){
"use strict";
return junotoys_alltrim(str, 'r');
}
function junotoys_padl(str, len){
"use strict";
var ch=arguments[2] ? arguments[2]:' ';
var rez=str.substr(0,len);
if(rez.length < len){
for (var i=0; i0) decimals--;
var ch=num.substr(i,1);
if(ch=='.'){
if(precision>0){
res +=ch;
}
decimals=precision;
}else if((ch>=0&&ch<=9)||(ch=='-'&&i==0))
res+=ch;
}
if(precision>0&&decimals!=0){
if(decimals==-1){
res +='.';
decimals=precision;
}
for (i=decimals; i>0; i--)
res +='0';
}
return res;
}
function junotoys_dec2hex(n){
"use strict";
return Number(n).toString(16);
}
function junotoys_hex2dec(hex){
"use strict";
return parseInt(hex,16);
}
function junotoys_in_array(val, thearray){
"use strict";
var rez=false;
for (var i=0; i thearray[y]){
tmp=thearray[x];
thearray[x]=thearray[y];
thearray[y]=tmp;
}}else{
if(thearray[x].toLowerCase() > thearray[y].toLowerCase()){
tmp=thearray[x];
thearray[x]=thearray[y];
thearray[y]=tmp;
}}
}}
return thearray;
}
function junotoys_parse_date(dt){
"use strict";
dt=dt.replace(/\//g, '-').replace(/\./g, '-').replace(/T/g, ' ').split('+')[0];
var dt2=dt.split(' ');
var d=dt2[0].split('-');
var t=dt2[1].split(':');
d.push(t[0], t[1], t[2]);
return d;
}
function junotoys_get_date_difference(dt1){
"use strict";
var dt2=arguments[1]!==undefined ? arguments[1]:'';
var short_date=arguments[2]!==undefined ? arguments[2]:true;
var sec=arguments[3]!==undefined ? arguments[3]:false;
var a1=junotoys_parse_date(dt1);
dt1=Date.UTC(a1[0], a1[1], a1[2], a1[3], a1[4], a1[5]);
if(dt2==''){
dt2=new Date();
var a2=[dt2.getFullYear(), dt2.getMonth()+1, dt2.getDate(), dt2.getHours(), dt2.getMinutes(), dt2.getSeconds()];
} else
var a2=junotoys_parse_date(dt2);
dt2=Date.UTC(a2[0], a2[1], a2[2], a2[3], a2[4], a2[5]);
var diff=Math.round((dt2 - dt1)/1000);
var days=Math.floor(diff / (24*3600));
diff -=days * 24 * 3600;
var hours=Math.floor(diff / 3600);
diff -=hours * 3600;
var minutes=Math.floor(diff / 60);
diff -=minutes * 60;
rez='';
if(days > 0)
rez +=(rez!='' ? ' ':'') + days + ' day' + (days > 1 ? 's':'');
if((!short_date||rez=='')&&hours > 0)
rez +=(rez!='' ? ' ':'') + hours + ' hour' + (hours > 1 ? 's':'');
if((!short_date||rez=='')&&minutes > 0)
rez +=(rez!='' ? ' ':'') + minutes + ' minute' + (minutes > 1 ? 's':'');
if(sec||rez=='')
rez +=rez!=''||sec ? (' ' + diff + ' second' + (diff > 1 ? 's':'')):'less then minute';
return rez;
}
function junotoys_hex2rgb(hex){
"use strict";
hex=parseInt(((hex.indexOf('#') > -1) ? hex.substring(1):hex), 16);
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};}
function junotoys_rgb2hex(color){
"use strict";
var aRGB;
color=color.replace(/\s/g,"").toLowerCase();
if(color=='rgba(0,0,0,0)'||color=='rgba(0%,0%,0%,0%)')
color='transparent';
if(color.indexOf('rgba(')==0)
aRGB=color.match(/^rgba\((\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?)\)$/i);
else
aRGB=color.match(/^rgb\((\d{1,3}[%]?),(\d{1,3}[%]?),(\d{1,3}[%]?)\)$/i);
if(aRGB){
color='';
for (var i=1; i<=3; i++)
color +=Math.round((aRGB[i][aRGB[i].length-1]=="%"?2.55:1)*parseInt(aRGB[i])).toString(16).replace(/^(.)$/,'0$1');
} else
color=color.replace(/^#?([\da-f])([\da-f])([\da-f])$/i, '$1$1$2$2$3$3');
return (color.substr(0,1)!='#' ? '#':'') + color;
}
function junotoys_components2hex(r,g,b){
"use strict";
return '#'+
Number(r).toString(16).toUpperCase().replace(/^(.)$/,'0$1') +
Number(g).toString(16).toUpperCase().replace(/^(.)$/,'0$1') +
Number(b).toString(16).toUpperCase().replace(/^(.)$/,'0$1');
}
function junotoys_rgb2components(color){
"use strict";
color=junotoys_rgb2hex(color);
var matches=color.match(/^#?([\dabcdef]{2})([\dabcdef]{2})([\dabcdef]{2})$/i);
if(!matches) return false;
for (var i=1, rgb=new Array(3); i<=3; i++)
rgb[i-1]=parseInt(matches[i],16);
return rgb;
}
function junotoys_hex2hsb(hex){
"use strict";
return junotoys_rgb2hsb(junotoys_hex2rgb(hex));
}
function junotoys_hsb2hex(hsb){
var rgb=junotoys_hsb2rgb(hsb);
return junotoys_components2hex(rgb.r, rgb.g, rgb.b);
}
function junotoys_rgb2hsb(rgb){
"use strict";
var hsb={};
hsb.b=Math.max(Math.max(rgb.r,rgb.g),rgb.b);
hsb.s=(hsb.b <=0) ? 0:Math.round(100*(hsb.b - Math.min(Math.min(rgb.r,rgb.g),rgb.b))/hsb.b);
hsb.b=Math.round((hsb.b /255)*100);
if((rgb.r==rgb.g)&&(rgb.g==rgb.b)) hsb.h=0;
else if(rgb.r>=rgb.g&&rgb.g>=rgb.b) hsb.h=60*(rgb.g-rgb.b)/(rgb.r-rgb.b);
else if(rgb.g>=rgb.r&&rgb.r>=rgb.b) hsb.h=60 + 60*(rgb.g-rgb.r)/(rgb.g-rgb.b);
else if(rgb.g>=rgb.b&&rgb.b>=rgb.r) hsb.h=120 + 60*(rgb.b-rgb.r)/(rgb.g-rgb.r);
else if(rgb.b>=rgb.g&&rgb.g>=rgb.r) hsb.h=180 + 60*(rgb.b-rgb.g)/(rgb.b-rgb.r);
else if(rgb.b>=rgb.r&&rgb.r>=rgb.g) hsb.h=240 + 60*(rgb.r-rgb.g)/(rgb.b-rgb.g);
else if(rgb.r>=rgb.b&&rgb.b>=rgb.g) hsb.h=300 + 60*(rgb.r-rgb.b)/(rgb.r-rgb.g);
else hsb.h=0;
hsb.h=Math.round(hsb.h);
return hsb;
}
function junotoys_hsb2rgb(hsb){
"use strict";
var rgb={};
var h=Math.round(hsb.h);
var s=Math.round(hsb.s*255/100);
var v=Math.round(hsb.b*255/100);
if(s==0){
rgb.r=rgb.g=rgb.b=v;
}else{
var t1=v;
var t2=(255-s)*v/255;
var t3=(t1-t2)*(h%60)/60;
if(h==360) h=0;
if(h<60){ rgb.r=t1; rgb.b=t2; rgb.g=t2+t3; }
else if(h<120){ rgb.g=t1; rgb.b=t2; rgb.r=t1-t3; }
else if(h<180){ rgb.g=t1; rgb.r=t2; rgb.b=t2+t3; }
else if(h<240){ rgb.b=t1; rgb.r=t2; rgb.g=t1-t3; }
else if(h<300){ rgb.b=t1; rgb.g=t2; rgb.r=t2+t3; }
else if(h<360){ rgb.r=t1; rgb.g=t2; rgb.b=t1-t3; }else{ rgb.r=0; rgb.g=0; rgb.b=0; }}
return { r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b) };}
function junotoys_color_picker(){
"use strict";
var id=arguments[0] ? arguments[0]:"iColorPicker"+Math.round(Math.random()*1000);
var colors=arguments[1] ? arguments[1] :
'#f00,#ff0,#0f0,#0ff,#00f,#f0f,#fff,#ebebeb,#e1e1e1,#d7d7d7,#cccccc,#c2c2c2,#b7b7b7,#acacac,#a0a0a0,#959595,'
+'#ee1d24,#fff100,#00a650,#00aeef,#2f3192,#ed008c,#898989,#7d7d7d,#707070,#626262,#555,#464646,#363636,#262626,#111,#000,'
+'#f7977a,#fbad82,#fdc68c,#fff799,#c6df9c,#a4d49d,#81ca9d,#7bcdc9,#6ccff7,#7ca6d8,#8293ca,#8881be,#a286bd,#bc8cbf,#f49bc1,#f5999d,'
+'#f16c4d,#f68e54,#fbaf5a,#fff467,#acd372,#7dc473,#39b778,#16bcb4,#00bff3,#438ccb,#5573b7,#5e5ca7,#855fa8,#a763a9,#ef6ea8,#f16d7e,'
+'#ee1d24,#f16522,#f7941d,#fff100,#8fc63d,#37b44a,#00a650,#00a99e,#00aeef,#0072bc,#0054a5,#2f3192,#652c91,#91278f,#ed008c,#ee105a,'
+'#9d0a0f,#a1410d,#a36209,#aba000,#588528,#197b30,#007236,#00736a,#0076a4,#004a80,#003370,#1d1363,#450e61,#62055f,#9e005c,#9d0039,'
+'#790000,#7b3000,#7c4900,#827a00,#3e6617,#045f20,#005824,#005951,#005b7e,#003562,#002056,#0c004b,#30004a,#4b0048,#7a0045,#7a0026';
var colorsList=colors.split(',');
var tbl='';
jQuery(document.createElement("div"))
.attr("id", id)
.css('display','none')
.html(tbl)
.appendTo("body")
.addClass("iColorPickerTable")
.on('mouseover', 'thead td', function(){
"use strict";
var aaa=junotoys_rgb2hex(jQuery(this).css('background-color'));
jQuery('#'+id+'_colorPreview').css('background',aaa);
jQuery('#'+id+'_colorPreview input').val(aaa);
})
.on('keypress', '#'+id+'_colorPreview input', function(key){
"use strict";
var aaa=jQuery(this).val()
if(aaa.length<7&&((key.which>=48&&key.which<=57)||(key.which>=97&&key.which<=102)||(key.which===35||aaa.length===0))){
aaa +=String.fromCharCode(key.which);
}else if(key.which==8&&aaa.length>0){
aaa=aaa.substring(0, aaa.length-1);
}else if(key.which===13&&(aaa.length===4||aaa.length===7)){
var fld=jQuery('#'+id).data('field');
var func=jQuery('#'+id).data('func');
if(func!=null&&func!='undefined'){
func(fld, aaa);
}else{
fld.val(aaa).css('backgroundColor', aaa).trigger('change');
}
jQuery('#'+id+'_Bg').fadeOut(500);
jQuery('#'+id).fadeOut(500);
}else{
key.preventDefault();
return false;
}
if(aaa.substr(0,1)==='#'&&(aaa.length===4||aaa.length===7)){
jQuery('#'+id+'_colorPreview').css('background',aaa);
}})
.on('click', 'thead td', function(e){
"use strict";
var fld=jQuery('#'+id).data('field');
var func=jQuery('#'+id).data('func');
var aaa=junotoys_rgb2hex(jQuery(this).css('background-color'));
if(func!=null&&func!='undefined'){
func(fld, aaa);
}else{
fld.val(aaa).css('backgroundColor', aaa).trigger('change');
}
jQuery('#'+id+'_Bg').fadeOut(500);
jQuery('#'+id).fadeOut(500);
e.preventDefault();
return false;
})
.on('click', 'tbody .iColorPicker_moreColors', function(e){
"use strict";
var thead=jQuery(this).parents('table').find('thead');
var out='';
if(thead.hasClass('more_colors')){
for (var i=0; i0 ? '':'') + '';
out +=' ';
}
thead.removeClass('more_colors').empty().html(out+' ');
jQuery('#'+id+'_colorPreview').attr('colspan', 8);
jQuery('#'+id+'_colorOriginal').attr('colspan', 8);
}else{
var rgb=[0,0,0], i=0, j=-1;
while (rgb[0]<0xF||rgb[1]<0xF||rgb[2]<0xF){
if(i%18==0) out +=(i>0 ? '':'') + '';
i++;
out +=' ';
rgb[2]+=3;
if(rgb[2]>0xF){
rgb[1]+=3;
if(rgb[1]>(j===0 ? 6:0xF)){
rgb[0]+=3;
if(rgb[0]>0xF){
if(j===0){
j=1;
rgb[0]=0;
rgb[1]=9;
rgb[2]=0;
}else{
break;
}}else{
rgb[1]=(j < 1 ? 0:9);
rgb[2]=0;
}}else{
rgb[2]=0;
}}
}
thead.addClass('more_colors').empty().html(out+' ');
jQuery('#'+id+'_colorPreview').attr('colspan', 9);
jQuery('#'+id+'_colorOriginal').attr('colspan', 9);
}
jQuery('#'+id+' table.colorPickerTable thead td')
.css({
'width':'12px',
'height':'14px',
'border':'1px solid #000',
'cursor':'pointer'
});
e.preventDefault();
return false;
});
jQuery(document.createElement("div"))
.attr("id", id+"_Bg")
.on('click', function(e){
"use strict";
jQuery("#"+id+"_Bg").fadeOut(500);
jQuery("#"+id).fadeOut(500);
e.preventDefault();
return false;
})
.appendTo("body");
jQuery('#'+id+' table.colorPickerTable thead td')
.css({
'width':'12px',
'height':'14px',
'border':'1px solid #000',
'cursor':'pointer'
});
jQuery('#'+id+' table.colorPickerTable')
.css({'border-collapse':'collapse'});
jQuery('#'+id)
.css({
'border':'1px solid #ccc',
'background':'#333',
'padding':'5px',
'color':'#fff',
'z-index':999999
});
jQuery('#'+id+'_colorPreview')
.css({'height':'50px'});
return id;
}
function junotoys_color_picker_show(id, fld, func){
"use strict";
if(id===null||id===''){
id=jQuery('.iColorPickerTable').attr('id');
}
var eICP=fld.offset();
var w=jQuery('#'+id).width();
var h=jQuery('#'+id).height();
var l=eICP.left + w < jQuery(window).width()-10 ? eICP.left:jQuery(window).width()-10 - w;
var t=eICP.top + fld.outerHeight() + h < jQuery(document).scrollTop() + jQuery(window).height()-10 ? eICP.top + fld.outerHeight():eICP.top - h - 13;
jQuery("#"+id)
.data({field: fld, func: func})
.css({
'top':t+"px",
'left':l+"px",
'position':'absolute',
'z-index':100001
})
.fadeIn(500);
jQuery("#"+id+"_Bg")
.css({
'position':'fixed',
'z-index':100000,
'top':0,
'left':0,
'width':'100%',
'height':'100%'
})
.fadeIn(500);
var def=fld.val().substr(0, 1)=='#' ? fld.val():junotoys_rgb2hex(fld.css('backgroundColor'));
jQuery('#'+id+'_colorPreview input,#'+id+'_colorOriginal input').val(def);
jQuery('#'+id+'_colorPreview,#'+id+'_colorOriginal').css('background',def);
}
function junotoys_get_cookie(name){
"use strict";
var defa=arguments[1]!=undefined ? arguments[1]:null;
var start=document.cookie.indexOf(name + '=');
var len=start + name.length + 1;
if((!start)&&(name!=document.cookie.substring(0, name.length))){
return defa;
}
if(start==-1)
return defa;
var end=document.cookie.indexOf(';', len);
if(end==-1)
end=document.cookie.length;
return unescape(document.cookie.substring(len, end));
}
function junotoys_set_cookie(name, value, expires, path, domain, secure){
"use strict";
var expires=arguments[2]!=undefined ? arguments[2]:0;
var path=arguments[3]!=undefined ? arguments[3]:'/';
var domain=arguments[4]!=undefined ? arguments[4]:'';
var secure=arguments[5]!=undefined ? arguments[5]:'';
var today=new Date();
today.setTime(today.getTime());
if(expires){
expires=expires * 1000 * 60 * 60 * 24;
}
var expires_date=new Date(today.getTime() + (expires));
document.cookie=name + '='
+ escape(value)
+ ((expires) ? ';expires=' + expires_date.toGMTString():'')
+ ((path) ? ';path=' + path:'')
+ ((domain) ? ';domain=' + domain:'')
+ ((secure) ? ';secure':'');
}
function junotoys_del_cookie(name, path, domain){
"use strict";
var path=arguments[1]!=undefined ? arguments[1]:'/';
var domain=arguments[2]!=undefined ? arguments[2]:'';
if(junotoys_get_cookie(name))
document.cookie=name + '=' + ((path) ? ';path=' + path:'')
+ ((domain) ? ';domain=' + domain:'')
+ ';expires=Thu, 01-Jan-1970 00:00:01 GMT';
}
function junotoys_clear_listbox(box){
"use strict";
for (var i=box.options.length-1; i>=0; i--)
box.options[i]=null;
}
function junotoys_add_listbox_item(box, val, text){
"use strict";
var item=new Option();
item.value=val;
item.text=text;
box.options.add(item);
}
function junotoys_del_listbox_item_by_value(box, val){
"use strict";
for (var i=0; i temp_opts[y].text){
temp=temp_opts[x];
temp_opts[x]=temp_opts[y];
temp_opts[y]=temp;
}}
}
for(var i=0; i 0&&val.length < opt.rules[i].min_length.value){
if(error_msg=='') jQuery(this).get(0).focus();
error_msg +='' + (typeof(opt.rules[i].min_length.message)!='undefined' ? opt.rules[i].min_length.message:opt.error_message_text) + '
'
error=true;
}}
if((!error||!opt.exit_after_first_error)&&typeof(opt.rules[i].max_length)=='object'){
if(opt.rules[i].max_length.value > 0&&val.length > opt.rules[i].max_length.value){
if(error_msg=='') jQuery(this).get(0).focus();
error_msg +='' + (typeof(opt.rules[i].max_length.message)!='undefined' ? opt.rules[i].max_length.message:opt.error_message_text) + '
'
error=true;
}}
if((!error||!opt.exit_after_first_error)&&typeof(opt.rules[i].mask)=='object'){
if(val.length > 0&&opt.rules[i].mask.value!=''){
var regexp=new RegExp(opt.rules[i].mask.value);
if(!regexp.test(val)){
if(error_msg=='') jQuery(this).get(0).focus();
error_msg +='' + (typeof(opt.rules[i].mask.message)!='undefined' ? opt.rules[i].mask.message:opt.error_message_text) + '
'
error=true;
}}
}
if((!error||!opt.exit_after_first_error)&&typeof(opt.rules[i].state)=='object'){
if(opt.rules[i].state.value=='checked'&&!jQuery(this).get(0).checked){
if(error_msg=='') jQuery(this).get(0).focus();
error_msg +='' + (typeof(opt.rules[i].state.message)!='undefined' ? opt.rules[i].state.message:opt.error_message_text) + '
'
error=true;
}}
if((!error||!opt.exit_after_first_error)&&typeof(opt.rules[i].equal_to)=='object'){
if(opt.rules[i].equal_to.value!=''&&val!=jQuery(jQuery(this).get(0).form[opt.rules[i].equal_to.value]).val()){
if(error_msg=='') jQuery(this).get(0).focus();
error_msg +='' + (typeof(opt.rules[i].equal_to.message)!='undefined' ? opt.rules[i].equal_to.message:opt.error_message_text) + '
'
error=true;
}}
if(opt.error_fields_class!='') jQuery(this).toggleClass(opt.error_fields_class, error);
}}
});
if(error_msg!=''&&opt.error_message_show){
var error_message_box=form.find(".result");
if(error_message_box.length==0) error_message_box=form.parent().find(".result");
if(error_message_box.length==0){
form.append('
');
error_message_box=form.find(".result");
}
if(opt.error_message_class) error_message_box.toggleClass(opt.error_message_class, true);
error_message_box.html(error_msg).fadeIn();
setTimeout(function(){ error_message_box.fadeOut(); }, opt.error_message_time);
}
return error_msg!='';
}
function junotoys_document_animate_to(id){
"use strict";
if(id.indexOf('#')==-1) id='#' + id;
var obj=jQuery(id).eq(0);
if(obj.length==0) return;
var oft=jQuery(id).offset().top;
var st=jQuery(window).scrollTop();
var speed=Math.min(1600, Math.max(400, Math.round(Math.abs(oft-st) / jQuery(window).height() * 100)));
jQuery('body,html').animate({scrollTop: oft - jQuery('#wpadminbar').height() - jQuery('header.fixedTopMenu .topWrap').height()}, speed, 'swing');
}
function junotoys_document_set_location(curLoc){
"use strict";
try {
history.pushState(null, null, curLoc);
return;
} catch(e){}
location.href=curLoc;
}
function junotoys_add_hidden_elements_handler(key, handler){
"use strict";
junotoys_storage_set_array('init_hidden_elements', key, handler);
}
function junotoys_init_hidden_elements(cont){
"use strict";
if(JUNOTOYS_STORAGE['init_hidden_elements']){
for (key in JUNOTOYS_STORAGE['init_hidden_elements']){
JUNOTOYS_STORAGE['init_hidden_elements'][key](cont);
}}
}
function junotoys_browser_is_mobile(){
"use strict";
var check=false;
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check=true})(navigator.userAgent||navigator.vendor||window.opera);
return check;
}
function junotoys_browser_is_ios(){
"use strict";
return navigator.userAgent.match(/iPad|iPhone|iPod/i)!=null;
}
function junotoys_is_retina(){
"use strict";
var mediaQuery='(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)';
return (window.devicePixelRatio > 1)||(window.matchMedia&&window.matchMedia(mediaQuery).matches);
}
function junotoys_get_file_name(path){
"use strict";
path=path.replace(/\\/g, '/');
var pos=path.lastIndexOf('/');
if(pos >=0)
path=path.substr(pos+1);
return path;
}
function junotoys_get_file_ext(path){
"use strict";
var pos=path.lastIndexOf('.');
path=pos >=0 ? path.substr(pos+1):'';
return path;
}
function junotoys_check_images_complete(cont){
"use strict";
var complete=true;
cont.find('img').each(function(){
if(!complete) return;
if(!jQuery(this).get(0).complete) complete=false;
});
return complete;
};
jQuery(document).ready(function(){
"use strict";
JUNOTOYS_STORAGE['theme_init_counter']=0;
junotoys_init_actions();
window.vc_prettyPhoto=function(){};});
jQuery(window).on('beforeunload', function(){
"use strict";
if(jQuery.browser&&!jQuery.browser.safari) jQuery('#page_preloader').css({display: 'block', opacity: 0}).animate({opacity:0.8}, 300);
});
function junotoys_init_actions(){
"use strict";
if(navigator.userAgent.indexOf('Mac') > 0)
jQuery('body').addClass('mac-os');
if(navigator.userAgent.indexOf('Safari') > 0)
jQuery('body').addClass('safari');
if(navigator.userAgent.indexOf('Chrome') > 0)
jQuery('body').addClass('chrome');
if(JUNOTOYS_STORAGE['vc_edit_mode']&&jQuery('.vc_empty-placeholder').length==0&&JUNOTOYS_STORAGE['theme_init_counter']++ < 30){
setTimeout(junotoys_init_actions, 200);
return;
}
jQuery('.vc_editor').find('.vc_trx_column_item').each(function (key, value){
var classList=jQuery(value).children().first()[0].className.split(/\s+/),
colSizeClassPattern=/column-\d+_\d+/;
classList.forEach(function(entry){
if(colSizeClassPattern.test(entry)!=null){
jQuery(value).first().addClass(entry);
}});
});
if(JUNOTOYS_STORAGE['use_ajax_views_counter']){
jQuery(document).ready(function(){
setTimeout(function(){
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'post_counter',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
post_id: JUNOTOYS_STORAGE['post_id'],
views: JUNOTOYS_STORAGE['views']
});
}, 10);
});
}
jQuery('#page_preloader').animate({opacity:0}, 500, function(){ jQuery(this).css({display: 'none'});});
if(junotoys_is_retina()){
junotoys_set_cookie('junotoys_retina', 1, 365);
}
junotoys_ready_actions();
setTimeout(function(){
jQuery(window).on('resize.junotoys', function(){
junotoys_resize_actions();
junotoys_scroll_actions()
}).trigger('resize.junotoys');
}, 10);
jQuery(window).on('scroll.junotoys', function(){
"use strict";
junotoys_scroll_actions();
});
}
function junotoys_ready_actions(){
"use strict";
if(window.junotoys_theme_ready_actions) junotoys_theme_ready_actions();
jQuery('.widget ul > li').each(function(){
if(jQuery(this).find('ul').length > 0){
jQuery(this).addClass('has_children');
}});
jQuery('.widget_archive a').each(function(){
var val=jQuery(this).html().split(' ');
if(val.length > 1){
val[val.length-1]='' + val[val.length-1] + ' ';
jQuery(this).html(val.join(' '))
}});
jQuery('.widget_subcategories').on('change', 'select', function(){
var dropdown=jQuery(this).get(0);
if(dropdown.options[dropdown.selectedIndex].value > 0){
location.href=JUNOTOYS_STORAGE['site_url'] + "/?cat="+dropdown.options[dropdown.selectedIndex].value;
}});
jQuery('.widget_calendar').on('click', '.month_prev a, .month_next a', function(e){
"use strict";
var calendar=jQuery(this).parents('.wp-calendar');
var m=jQuery(this).data('month');
var y=jQuery(this).data('year');
var l=jQuery(this).data('letter');
var pt=jQuery(this).data('type');
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'calendar_change_month',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
letter: l,
month: m,
year: y,
post_type: pt
}).done(function(response){
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: JUNOTOYS_STORAGE['ajax_error'] };
console.log(response);
}
if(rez.error===''){
calendar.parent().fadeOut(200, function(){
jQuery(this).find('.wp-calendar').remove();
jQuery(this).append(rez.data).fadeIn(200);
});
}});
e.preventDefault();
return false;
});
jQuery('.video_background').each(function(){
var youtube=jQuery(this).data('youtube-code');
if(youtube){
jQuery(this).tubular({videoId: youtube});
}});
jQuery('.slider_over_button,.slider_over_close').on('click', function(e){
jQuery(this).parent().toggleClass('opened');
e.preventDefault();
return false;
});
if(jQuery('ul#menu_side').length > 0){
jQuery('ul#menu_side').clone().removeAttr('id').removeClass('menu_side_nav').addClass('menu_side_responsive').insertAfter('ul#menu_side');
junotoys_show_current_menu_item(jQuery('.menu_side_responsive'), jQuery('.sidebar_outer_menu_responsive_button'));
}
if(jQuery('.header_mobile').length > 0){
jQuery('.header_mobile .menu_main_nav_area ul#menu_main').removeAttr('id');
jQuery('.header_mobile .menu_button').on('click', function(){
jQuery('.header_mobile .side_wrap').toggleClass('open');
jQuery('.header_mobile .mask').toggleClass('show');
jQuery('html').toggleClass('menu_mobile_open');
if(junotoys_browser_is_ios()&&jQuery('body').hasClass('menu_mobile')){
jQuery('body').toggleClass('ios_fixed');
}});
jQuery('.header_mobile .mask, .header_mobile .side_wrap .close').on('click', function(){
jQuery('.header_mobile .side_wrap').removeClass('open');
jQuery('.header_mobile .mask').removeClass('show');
jQuery('html').removeClass('menu_mobile_open');
if(junotoys_browser_is_ios()&&jQuery('body').hasClass('menu_mobile')){
jQuery('body').removeClass('ios_fixed');
}});
}
jQuery('.menu_pushy_button').on('click', function(e){
"use strict";
jQuery('body').addClass('pushy-active').css('overflow', 'hidden');
jQuery('.site-overlay').fadeIn('fast');
e.preventDefault();
return false;
});
jQuery('.pushy .close-pushy,.site-overlay').on('click', function(e){
jQuery('body').removeClass('pushy-active').css('overflow', 'visible');
jQuery('.site-overlay').fadeOut('fast');
e.preventDefault();
return false;
});
jQuery('.sidebar_outer_widgets_button').on('click', function(e){
"use strict";
jQuery('.sidebar_outer_widgets').slideToggle();
e.preventDefault();
return false;
});
jQuery('.header_mobile .menu_main_nav .menu-item-has-children > a, .menu_side_responsive .menu-item-has-children > a, .menu_pushy_nav_area .menu-item-has-children > a, body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories ul.product-categories .has_children > a').prepend('');
jQuery('.header_mobile .menu_main_nav, .menu_side_responsive, .menu_pushy_nav_area, body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories').on('click', 'li a,li a .open_child_menu, ul.product-categories.plain li a .open_child_menu', function(e){
"use strict";
var is_menu_main=jQuery(this).parents('.menu_main_nav').length > 0;
var $a=jQuery(this).hasClass('open_child_menu') ? jQuery(this).parent():jQuery(this);
if((!is_menu_main||jQuery('body').hasClass('menu_mobile'))&&($a.parent().hasClass('menu-item-has-children')||$a.parent().hasClass('has_children'))){
if($a.siblings('ul:visible').length > 0)
$a.siblings('ul').slideUp().parent().removeClass('opened');
else {
jQuery(this).parents('li').siblings('li').find('ul:visible').slideUp().parent().removeClass('opened');
$a.siblings('ul').slideDown().parent().addClass('opened');
}}
if(jQuery(this).hasClass('open_child_menu')||$a.attr('href')=='#'){
e.preventDefault();
return false;
}});
if(jQuery('.top_panel_style_9').length > 0){
var menu_class=jQuery('.top_panel_style_9 .menu_main_nav').attr('class');
var numb=jQuery('.top_panel_style_9 .menu_main_nav > li.menu-item').length;
if(numb > 1){
jQuery('.top_panel_style_9 .menu_main_nav').addClass('left');
var center=Math.ceil(numb / 2) + 1;
var right_ul='';
jQuery('.top_panel_style_9 .menu_main_nav').after(right_ul);
jQuery('.top_panel_style_9 .menu_main_nav.left > li.menu-item:nth-child(n + ' + center + ')').clone().appendTo('.top_panel_style_9 .menu_main_nav.right');
jQuery('.top_panel_style_9 .menu_main_nav.left > li.menu-item:nth-child(n + ' + (center) + ')').remove();
jQuery('.top_panel_style_9 .top_panel_middle .search_wrap').each(function(){
var close='
';
jQuery(this).append(close);
jQuery(this).find('.close').click(function(){
jQuery('.top_panel_style_9 .top_panel_middle .search_wrap.search_state_opened').removeClass('search_state_opened').addClass('search_state_closed');
});
});
}}
junotoys_init_sfmenu('header .menu_main_nav_area ul.menu_main_nav, ul#menu_user, ul#menu_side, body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories ul.product-categories');
if(JUNOTOYS_STORAGE['menu_hover']=='slide_line'||JUNOTOYS_STORAGE['menu_hover']=='slide_box'){
setTimeout(function(){
"use strict";
jQuery('#menu_main').spasticNav({
style: JUNOTOYS_STORAGE['menu_hover']=='slide_line' ? 'line':'box',
color: JUNOTOYS_STORAGE['accent1_hover'],
colorOverride: false
});
}, 500);
}
if(JUNOTOYS_STORAGE['toc_menu']!='hide'&&JUNOTOYS_STORAGE['toc_menu']!='no'){
junotoys_build_page_toc();
}
jQuery('#toc, ul#menu_main li, ul#menu_user li, ul#menu_side li, ul#menu_footer li, ul#menu_pushy li').on('click', 'a', function(e){
"use strict";
var href=jQuery(this).attr('href');
if(href===undefined) return;
var pos=href.indexOf('#');
if(pos < 0||href.length==1) return;
if(jQuery(href.substr(pos)).length > 0){
var loc=window.location.href;
var pos2=loc.indexOf('#');
if(pos2 > 0) loc=loc.substring(0, pos2);
var now=pos==0;
if(!now) now=loc==href.substring(0, pos);
if(now){
junotoys_document_animate_to(href.substr(pos));
junotoys_document_set_location(pos==0 ? loc + href:href);
e.preventDefault();
return false;
}}
});
JUNOTOYS_STORAGE['top_panel_height']=0; //Math.max(0, jQuery('.top_panel_wrap').height());
JUNOTOYS_STORAGE['side_panel_height']=0;
jQuery('.pager_cur').on('click', function(e){
"use strict";
jQuery('.pager_slider').slideDown(300, function(){
junotoys_sc_init(jQuery('.pager_slider').eq(0));
});
e.preventDefault();
return false;
});
jQuery('#viewmore_link').on('click', function(e){
"use strict";
if(!JUNOTOYS_STORAGE['viewmore_busy']&&!jQuery(this).hasClass('viewmore_empty')){
jQuery(this).parent().addClass('loading');
JUNOTOYS_STORAGE['viewmore_busy']=true;
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'view_more_posts',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
page: +JUNOTOYS_STORAGE['viewmore_page'] + 1,
data: JUNOTOYS_STORAGE['viewmore_data'],
vars: JUNOTOYS_STORAGE['viewmore_vars']
}).done(function(response){
"use strict";
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: JUNOTOYS_STORAGE['ajax_error'] };
console.log(response);
}
jQuery('#viewmore_link').parent().removeClass('loading');
JUNOTOYS_STORAGE['viewmore_busy']=false;
if(rez.error===''){
var posts_container=jQuery('.content').eq(0);
if(posts_container.find('.isotope_wrap').length > 0) posts_container=posts_container.find('.isotope_wrap').eq(0);
if(posts_container.hasClass('isotope_wrap')){
posts_container.data('last-width', 0).append(rez.data);
JUNOTOYS_STORAGE['isotope_init_counter']=0;
junotoys_init_appended_isotope(posts_container, rez.filters);
} else
jQuery('#viewmore').before(rez.data);
JUNOTOYS_STORAGE['viewmore_page']++;
if(rez.no_more_data==1){
jQuery('#viewmore_link').addClass('viewmore_empty').parent().hide();
}
junotoys_init_post_formats();
junotoys_sc_init(posts_container);
junotoys_scroll_actions();
}});
}
e.preventDefault();
return false;
});
jQuery('.woocommerce,.woocommerce-page').on('click', '.mode_buttons a', function(e){
"use strict";
var mode=jQuery(this).hasClass('woocommerce_thumbs') ? 'thumbs':'list';
junotoys_set_cookie('junotoys_shop_mode', mode, 365);
jQuery(this).siblings('input').val(mode).parents('form').get(0).submit();
e.preventDefault();
return false;
});
jQuery(document).bind('added_to_cart', function(){
"use strict";
var total=jQuery('.widget_shopping_cart').eq(0).find('.total .amount').text();
if(total!=undefined){
jQuery('.top_panel_cart_button .cart_summa').text(total);
}
var cnt=0;
jQuery('.widget_shopping_cart_content').eq(0).find('.cart_list li').each(function(){
var q=jQuery(this).find('.quantity').html().split(' ', 2);
if(!isNaN(q[0]))
cnt +=Number(q[0]);
});
var items=jQuery('.top_panel_cart_button .cart_items').eq(0).text().split(' ', 2);
items[0]=cnt;
jQuery('.top_panel_cart_button .cart_items').text(items[0]+' '+items[1]);
jQuery('.top_panel_cart_button').data({
'items': cnt ? cnt:0,
'summa': total ? total:0
});
});
jQuery('.top_panel_middle .top_panel_cart_button, .header_mobile .top_panel_cart_button').on('click', function(e){
"use strict";
jQuery(this).siblings('.sidebar_cart').slideToggle();
e.preventDefault();
return false;
});
jQuery('.woocommerce div.quantity,.woocommerce-page div.quantity').append(' ');
jQuery('.woocommerce div.quantity').on('click', '>span', function(e){
"use strict";
var f=jQuery(this).siblings('input');
if(jQuery(this).hasClass('q_inc')){
f.val(Math.max(0, parseInt(f.val()))+1);
}else{
f.val(Math.max(1, Math.max(0, parseInt(f.val()))-1));
}
e.preventDefault();
return false;
});
jQuery('.single-product .woocommerce-tabs')
.addClass('trx-stretch-width scheme_light')
.after('
');
junotoys_stretch_width();
jQuery('.popup_link,.popup_login_link,.popup_register_link').addClass('inited').on('click', function(e){
var popup=jQuery(jQuery(this).attr('href'));
if(popup.length===1){
junotoys_hide_popup(jQuery(popup.hasClass('popup_login') ? '.popup_registration':'.popup_login'));
junotoys_show_popup(popup);
}
e.preventDefault();
return false;
});
jQuery('.popup_wrap').on('click', '.popup_close', function(e){
var popup=jQuery(this).parent();
if(popup.length===1){
junotoys_hide_popup(popup);
}
e.preventDefault();
return false;
});
jQuery('.bookmarks_add').on('click', function(e){
"use strict";
var title=window.document.title.split('|')[0];
var url=window.location.href;
var list=jQuery.cookie('junotoys_bookmarks');
var exists=false;
if(list){
try {
list=JSON.parse(list);
} catch (e){}
if(list.length){
for (var i=0; i'+JUNOTOYS_STORAGE['strings']['bookmark_title']+' ', JUNOTOYS_STORAGE['strings']['bookmark_add'], null,
function(btn, popup){
"use strict";
if(btn!=1) return;
title=message_popup.find('#bookmark_title').val();
list.push({title: title, url: url});
jQuery('.bookmarks_list').append(''+title+' ');
jQuery.cookie('junotoys_bookmarks', JSON.stringify(list), {expires: 365, path: '/'});
setTimeout(function (){junotoys_message_success(JUNOTOYS_STORAGE['strings']['bookmark_added'], JUNOTOYS_STORAGE['strings']['bookmark_add']);}, JUNOTOYS_STORAGE['message_timeout']/4);
});
} else
junotoys_message_warning(JUNOTOYS_STORAGE['strings']['bookmark_exists'], JUNOTOYS_STORAGE['strings']['bookmark_add']);
e.preventDefault();
return false;
});
jQuery('.bookmarks_list').on('click', '.bookmarks_delete', function(e){
"use strict";
var idx=jQuery(this).parent().index();
var list=jQuery.cookie('junotoys_bookmarks');
if(list){
try {
list=JSON.parse(list);
} catch (e){}
if(list.length){
list.splice(idx, 1);
jQuery.cookie('junotoys_bookmarks', JSON.stringify(list), {expires: 365, path: '/'});
}}
jQuery(this).parent().remove();
e.preventDefault();
return false;
});
if(jQuery('input[type="checkbox"][name="i_agree_privacy_policy"]:not(.inited),input[type="checkbox"][name="gdpr_terms"]:not(.inited),input[type="checkbox"][name="wpgdprc"]:not(.inited)').length > 0){
jQuery('input[type="checkbox"][name="i_agree_privacy_policy"]:not(.inited),input[type="checkbox"][name="gdpr_terms"]:not(.inited),input[type="checkbox"][name="wpgdprc"]:not(.inited)')
.addClass('inited')
.on('change', function(e){
if(jQuery(this).get(0).checked)
jQuery(this).parents('form').find('button,input[type="submit"],a[data-group="E-mailer"]').removeAttr('disabled');
else
jQuery(this).parents('form').find('button,input[type="submit"],aa[data-group="E-mailer"]').attr('disabled', 'disabled');
}).trigger('change');
}
jQuery('.scroll_to_top').on('click', function(e){
"use strict";
jQuery('html,body').animate({
scrollTop: 0
}, 'slow');
e.preventDefault();
return false;
});
if(JUNOTOYS_STORAGE['ajax_views_counter']!==undefined){
setTimeout(function(){
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'post_counter',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
post_id: JUNOTOYS_STORAGE['ajax_views_counter']['post_id'],
views: JUNOTOYS_STORAGE['ajax_views_counter']['post_views']
});
}, 10);
}
junotoys_show_system_message();
junotoys_init_post_formats();
if(window.junotoys_sc_init_actions) junotoys_sc_init_actions();
if(window.junotoys_init_hidden_elements) junotoys_init_hidden_elements(jQuery('body').eq(0));
jQuery('.sc_promo[data-href], .sc_tabs .sc_tabs_content[data-href]').click(function(){
var link=jQuery(this).data('href');
window.location.href=link;
});
}
function junotoys_scroll_actions(){
"use strict";
if(window.junotoys_theme_scroll_actions) junotoys_theme_scroll_actions();
var scroll_offset=jQuery(window).scrollTop();
var scroll_to_top_button=jQuery('.scroll_to_top');
var adminbar_height=Math.max(0, jQuery('#wpadminbar').height());
if(JUNOTOYS_STORAGE['top_panel_height'] < 1){
JUNOTOYS_STORAGE['top_panel_height']=Math.max(0, jQuery('.top_panel_wrap').height());
}
if(scroll_offset > JUNOTOYS_STORAGE['top_panel_height'])
scroll_to_top_button.addClass('show');
else
scroll_to_top_button.removeClass('show');
if(!jQuery('body').hasClass('menu_mobile')&&JUNOTOYS_STORAGE['menu_fixed']){
var slider_height=0;
if(jQuery('.top_panel_below .slider_wrap').length > 0){
slider_height=jQuery('.top_panel_below .slider_wrap').height();
if(slider_height < 10){
slider_height=jQuery('.slider_wrap').hasClass('.slider_fullscreen') ? jQuery(window).height():JUNOTOYS_STORAGE['slider_height'];
}}
if(scroll_offset <=slider_height + JUNOTOYS_STORAGE['top_panel_height']){
if(jQuery('body').hasClass('top_panel_fixed')){
jQuery('body').removeClass('top_panel_fixed');
}}else if(scroll_offset > slider_height + JUNOTOYS_STORAGE['top_panel_height']){
if(!jQuery('body').hasClass('top_panel_fixed')&&jQuery(document).height() > jQuery(window).height()*1.5){
jQuery('.top_panel_fixed_wrap').height(JUNOTOYS_STORAGE['top_panel_height']);
jQuery('.top_panel_wrap').css('marginTop', '-150px').animate({'marginTop': 0}, 500);
jQuery('body').addClass('top_panel_fixed');
}}
}
if(jQuery('.sidebar_outer').length > 0){
if(JUNOTOYS_STORAGE['side_panel_height']==0)
JUNOTOYS_STORAGE['side_panel_height']=jQuery('.sidebar_outer_logo_wrap').outerHeight() + jQuery('.sidebar_outer_menu').outerHeight() + jQuery('.sidebar_outer_widgets').outerHeight();
if(scroll_offset + jQuery(window).height() > JUNOTOYS_STORAGE['side_panel_height'] + 100){
if(jQuery('.sidebar_outer').css('position')!=='fixed'){
jQuery('.sidebar_outer').css({
'position': 'fixed',
'top': Math.min(0, jQuery(window).height() - JUNOTOYS_STORAGE['side_panel_height'] - 100) + 'px',
});
}}else{
if(jQuery('.sidebar_outer').css('position')=='fixed'){
jQuery('.sidebar_outer').css({
'position': 'absolute',
'top': 0
});
}}
}
jQuery('#toc .toc_item').each(function(){
"use strict";
var id=jQuery(this).find('a').attr('href');
var pos=id.indexOf('#');
if(pos < 0||id.length==1) return;
var loc=window.location.href;
var pos2=loc.indexOf('#');
if(pos2 > 0) loc=loc.substring(0, pos2);
var now=pos==0;
if(!now) now=loc==href.substring(0, pos);
if(!now) return;
var off=jQuery(id).offset().top;
var id_next=jQuery(this).next().find('a').attr('href');
var off_next=id_next ? jQuery(id_next).offset().top:1000000;
if(off < scroll_offset + jQuery(window).height()*0.8&&scroll_offset + JUNOTOYS_STORAGE['top_panel_height'] < off_next)
jQuery(this).addClass('current');
else
jQuery(this).removeClass('current');
});
junotoys_infinite_scroll()
junotoys_parallax_scroll();
if(window.junotoys_sc_scroll_actions) junotoys_sc_scroll_actions();
}
function junotoys_infinite_scroll(){
"use strict";
if(JUNOTOYS_STORAGE['viewmore_busy']) return;
var infinite=jQuery('#viewmore.pagination_infinite');
if(infinite.length > 0){
var viewmore=infinite.find('#viewmore_link:not(.viewmore_empty)');
if(viewmore.length > 0){
if(jQuery(window).scrollTop() + jQuery(window).height() + 100 >=infinite.offset().top){
viewmore.eq(0).trigger('click');
}}
}}
function junotoys_parallax_scroll(){
"use strict";
jQuery('.sc_parallax').each(function(){
var windowHeight=jQuery(window).height();
var scrollTops=jQuery(window).scrollTop();
var offsetPrx=Math.max(jQuery(this).offset().top, windowHeight);
if(offsetPrx <=scrollTops + windowHeight){
var speed=Number(jQuery(this).data('parallax-speed'));
var xpos=jQuery(this).data('parallax-x-pos');
var ypos=Math.round((offsetPrx - scrollTops - windowHeight) * speed + (speed < 0 ? windowHeight*speed:0));
jQuery(this).find('.sc_parallax_content').css('backgroundPosition', xpos+' '+ypos+'px');
jQuery(this).find('div.sc_video_bg').css('top', ypos+'px');
}});
}
function junotoys_resize_actions(){
"use strict";
if(window.junotoys_theme_resize_actions) junotoys_theme_resize_actions();
JUNOTOYS_STORAGE['top_panel_height']=0;
junotoys_responsive_menu();
junotoys_vc_row_fullwidth_to_boxed();
junotoys_video_dimensions();
junotoys_resize_video_background();
junotoys_resize_fullscreen_slider();
junotoys_resize_alter_portfolio();
junotoys_stretch_width();
if(window.junotoys_sc_resize_actions) junotoys_sc_resize_actions();
}
function junotoys_stretch_width(){
"use strict";
jQuery('.trx-stretch-width').each(function(){
var $el=jQuery(this);
var $el_full=$el.next('.trx-stretch-width-original');
var el_margin_left=parseInt($el.css('margin-left'), 10);
var el_margin_right=parseInt($el.css('margin-right'), 10);
var offset=0 - $el_full.offset().left - el_margin_left;
var width=jQuery(window).width();
if(!$el.hasClass('inited')){
$el.addClass('inited invisible');
$el.css({
'position': 'relative',
'box-sizing': 'border-box'
});
}
$el.css({
'left': offset,
'width': jQuery(window).width()
});
if(!$el.hasClass('trx-stretch-content')){
var padding=Math.max(0, -1*offset);
var paddingRight=Math.max(0, width - padding - $el_full.width() + el_margin_left + el_margin_right);
$el.css({ 'padding-left': padding + 'px', 'padding-right': paddingRight + 'px' });
}
$el.removeClass('invisible');
});
}
function junotoys_vc_row_fullwidth_to_boxed(){
"use strict";
if(jQuery('body').hasClass('body_style_boxed')){
var width_body=jQuery('body').width();
var width_content=jQuery('.page_wrap').width();
var width_content_wrap=jQuery('.page_content_wrap .content_wrap').width();
var indent=(width_content - width_content_wrap) / 2;
if(width_body > width_content){
jQuery('.vc_row[data-vc-full-width="true"]').each(function(){
"use strict";
var mrg=parseInt(jQuery(this).css('marginLeft'));
jQuery(this).css({
'width': width_content,
'left': -indent-mrg,
'padding-left': indent+mrg,
'padding-right': indent+mrg
});
if(jQuery(this).attr('data-vc-stretch-content')){
jQuery(this).css({
'padding-left': 0,
'padding-right': 0
});
}});
}}
}
function junotoys_responsive_menu(){
"use strict";
if(junotoys_is_responsive_need(JUNOTOYS_STORAGE['menu_mobile'])){
if(!jQuery('body').hasClass('menu_mobile')){
jQuery('body').removeClass('top_panel_fixed').addClass('menu_mobile');
if(!jQuery('body').hasClass('body_mega_menu')){
jQuery('header.top_panel_wrap ').hide();
jQuery('.header_mobile').show();
jQuery('header #popup_login').attr('id', 'popup_login_1');
jQuery('header #popup_registration').attr('id', 'popup_registration_1');
jQuery('.header_mobile #popup_login_1').attr('id', 'popup_login');
jQuery('.header_mobile #popup_registration_1').attr('id', 'popup_registration');
}}
}else{
if(jQuery('body').hasClass('menu_mobile')){
jQuery('body').removeClass('menu_mobile');
jQuery('header.top_panel_wrap ').show();
jQuery('.header_mobile').hide();
jQuery('header #popup_login_1').attr('id', 'popup_login');
jQuery('header #popup_registration_1').attr('id', 'popup_registration');
jQuery('.header_mobile #popup_login').attr('id', 'popup_login_1');
jQuery('.header_mobile #popup_registration').attr('id', 'popup_registration_1');
}}
if(jQuery(window).width() < 640){
var pass=jQuery('.header_mobile .popup_wrap.popup_registration .registration_form > .form_right');
if(pass.length > 0){
jQuery('.header_mobile .popup_wrap.popup_registration .form_left .popup_form_field.email_field').after(pass);
}}else{
var pass=jQuery('.header_mobile .popup_wrap.popup_registration .form_left > .form_right');
if(pass.length > 0){
jQuery('.header_mobile .popup_wrap.popup_registration .registration_form').append(pass);
}}
if(!jQuery('.top_panel_wrap').hasClass('menu_show')) jQuery('.top_panel_wrap').addClass('menu_show');
if(jQuery('.sidebar_outer').length > 0&&jQuery('.sidebar_outer').css('position')=='absolute'&&jQuery('.sidebar_outer_widgets:visible').length==0)
jQuery('.sidebar_outer_widgets').show();
var cat_menu=jQuery('body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories ul.product-categories');
var sb=cat_menu.parents('.widget_area');
if(sb.length > 0&&cat_menu.length > 0){
if(sb.width()==sb.parents('.content_wrap').width()){
if(cat_menu.hasClass('inited')){
cat_menu.removeClass('inited').addClass('plain').superfish('destroy');
cat_menu.find('ul.animated').removeClass('animated').addClass('no_animated');
}}else{
if(!cat_menu.hasClass('inited')){
cat_menu.removeClass('plain').addClass('inited');
cat_menu.find('ul.no_animated').removeClass('no_animated').addClass('animated');
junotoys_init_sfmenu('body:not(.woocommerce) .widget_area:not(.footer_wrap) .widget_product_categories ul.product-categories');
}}
}}
function junotoys_is_responsive_need(max_width){
"use strict";
var rez=false;
if(max_width > 0){
var w=window.innerWidth;
if(w==undefined){
w=jQuery(window).width()+(jQuery(window).height() < jQuery(document).height()||jQuery(window).scrollTop() > 0 ? 16:0);
}
rez=max_width > w;
}
return rez;
}
function junotoys_video_dimensions(){
jQuery('.sc_video_frame').each(function(){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var frame=jQuery(this).eq(0);
var player=frame.parent();
var ratio=(frame.data('ratio') ? frame.data('ratio').split(':'):(frame.find('[data-ratio]').length>0 ? frame.find('[data-ratio]').data('ratio').split(':'):[16,9]));
ratio=ratio.length!=2||ratio[0]==0||ratio[1]==0 ? 16/9:ratio[0]/ratio[1];
var w_attr=frame.data('width');
var h_attr=frame.data('height');
if(!w_attr||!h_attr) return;
var percent=(''+w_attr).substr(-1)=='%';
w_attr=parseInt(w_attr);
h_attr=parseInt(h_attr);
var w_real=Math.min(percent||frame.parents('.columns_wrap').length>0 ? 10000:w_attr, frame.parents('div,article').width()), //player.width();
h_real=Math.round(percent ? w_real/ratio:w_real/w_attr*h_attr);
if(parseInt(frame.attr('data-last-width'))==w_real) return;
if(percent){
frame.height(h_real);
}else{
frame.css({'width': w_real+'px', 'height': h_real+'px'});
}
frame.attr('data-last-width', w_real);
});
jQuery('video.sc_video,video.wp-video-shortcode').each(function(){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var video=jQuery(this).eq(0);
var ratio=(video.data('ratio')!=undefined ? video.data('ratio').split(':'):[16,9]);
ratio=ratio.length!=2||ratio[0]==0||ratio[1]==0 ? 16/9:ratio[0]/ratio[1];
var mejs_cont=video.parents('.mejs-video');
var frame=video.parents('.sc_video_frame');
var w_attr=frame.length>0 ? frame.data('width'):video.data('width');
var h_attr=frame.length>0 ? frame.data('height'):video.data('height');
if(!w_attr||!h_attr){
w_attr=video.attr('width');
h_attr=video.attr('height');
if(!w_attr||!h_attr) return;
video.data({'width': w_attr, 'height': h_attr});
}
var percent=(''+w_attr).substr(-1)=='%';
w_attr=parseInt(w_attr);
h_attr=parseInt(h_attr);
var w_real=Math.round(mejs_cont.length > 0 ? Math.min(percent ? 10000:w_attr, mejs_cont.parents('div,article').width()):video.width()),
h_real=Math.round(percent ? w_real/ratio:w_real/w_attr*h_attr);
if(parseInt(video.attr('data-last-width'))==w_real) return;
if(mejs_cont.length > 0&&mejs){
junotoys_set_mejs_player_dimensions(video, w_real, h_real);
}
if(percent){
video.height(h_real);
}else{
video.attr({'width': w_real, 'height': h_real}).css({'width': w_real+'px', 'height': h_real+'px'});
}
video.attr('data-last-width', w_real);
});
jQuery('video.sc_video_bg').each(function(){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var video=jQuery(this).eq(0);
var ratio=(video.data('ratio')!=undefined ? video.data('ratio').split(':'):[16,9]);
ratio=ratio.length!=2||ratio[0]==0||ratio[1]==0 ? 16/9:ratio[0]/ratio[1];
var mejs_cont=video.parents('.mejs-video');
var container=mejs_cont.length>0 ? mejs_cont.parent():video.parent();
var w=container.width();
var h=container.height();
var w1=Math.ceil(h*ratio);
var h1=Math.ceil(w/ratio);
if(video.parents('.sc_parallax').length > 0){
var windowHeight=jQuery(window).height();
var speed=Number(video.parents('.sc_parallax').data('parallax-speed'));
var h_add=Math.ceil(Math.abs((windowHeight-h)*speed));
if(h1 < h + h_add){
h1=h + h_add;
w1=Math.ceil(h1 * ratio);
}}
if(h1 < h){
h1=h;
w1=Math.ceil(h1 * ratio);
}
if(w1 < w){
w1=w;
h1=Math.ceil(w1 / ratio);
}
var l=Math.round((w1-w)/2);
var t=Math.round((h1-h)/2);
if(parseInt(video.attr('data-last-width'))==w1) return;
if(mejs_cont.length > 0){
junotoys_set_mejs_player_dimensions(video, w1, h1);
mejs_cont.css({
'top': -t+'px'
});
} else
video.css({
'top': -t+'px'
});
video.attr({'width': w1, 'height': h1, 'data-last-width':w1}).css({'width':w1+'px', 'height':h1+'px'});
if(video.css('opacity')==0) video.animate({'opacity': 1}, 3000);
});
jQuery('iframe').each(function(){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var iframe=jQuery(this).eq(0);
var ratio=(iframe.data('ratio')!=undefined ? iframe.data('ratio').split(':'):(iframe.find('[data-ratio]').length>0 ? iframe.find('[data-ratio]').data('ratio').split(':'):[16,9]));
ratio=ratio.length!=2||ratio[0]==0||ratio[1]==0 ? 16/9:ratio[0]/ratio[1];
var w_attr=iframe.attr('width');
var h_attr=iframe.attr('height');
var frame=iframe.parents('.sc_video_frame');
if(frame.length > 0){
w_attr=frame.data('width');
h_attr=frame.data('height');
}
if(!w_attr||!h_attr){
return;
}
var percent=(''+w_attr).substr(-1)=='%';
w_attr=parseInt(w_attr);
h_attr=parseInt(h_attr);
var w_real=frame.length > 0 ? frame.width():iframe.width(),
h_real=Math.round(percent ? w_real/ratio:w_real/w_attr*h_attr);
if(parseInt(iframe.attr('data-last-width'))==w_real) return;
iframe.css({'width': w_real+'px', 'height': h_real+'px'});
});
}
function junotoys_resize_video_background(){
"use strict";
var bg=jQuery('.video_bg');
if(bg.length < 1)
return;
if(JUNOTOYS_STORAGE['media_elements_enabled']&&bg.find('.mejs-video').length==0){
setTimeout(junotoys_resize_video_background, 100);
return;
}
var video=bg.find('video');
var ratio=(video.data('ratio')!=undefined ? video.data('ratio').split(':'):[16,9]);
ratio=ratio.length!=2||ratio[0]==0||ratio[1]==0 ? 16/9:ratio[0]/ratio[1];
var w=bg.width();
var h=bg.height();
var w1=Math.ceil(h*ratio);
var h1=Math.ceil(w/ratio);
if(h1 < h){
h1=h;
w1=Math.ceil(h1 * ratio);
}
if(w1 < w){
w1=w;
h1=Math.ceil(w1 / ratio);
}
var l=Math.round((w1-w)/2);
var t=Math.round((h1-h)/2);
if(bg.find('.mejs-container').length > 0){
junotoys_set_mejs_player_dimensions(bg.find('video'), w1, h1);
bg.find('.mejs-container').css({'left': -l+'px', 'top': -t+'px'});
} else
bg.find('video').css({'left': -l+'px', 'top': -t+'px'});
bg.find('video').attr({'width': w1, 'height': h1}).css({'width':w1+'px', 'height':h1+'px'});
}
function junotoys_set_mejs_player_dimensions(video, w, h){
"use strict";
if(mejs){
for (var pl in mejs.players){
if(mejs.players[pl].media.src==video.attr('src')){
if(mejs.players[pl].media.setVideoSize){
mejs.players[pl].media.setVideoSize(w, h);
}
mejs.players[pl].setPlayerSize(w, h);
mejs.players[pl].setControlsSize();
}}
}}
function junotoys_resize_fullscreen_slider(){
"use strict";
var slider_wrap=jQuery('.slider_wrap.slider_fullscreen');
if(slider_wrap.length < 1)
return;
var slider=slider_wrap.find('.sc_slider_swiper');
if(slider.length < 1)
return;
var h=jQuery(window).height() - jQuery('#wpadminbar').height() - (jQuery('body').hasClass('top_panel_above')&&!jQuery('body').hasClass('.top_panel_fixed') ? jQuery('.top_panel_wrap').height():0);
slider.height(h);
}
function junotoys_resize_alter_portfolio(){
"use strict";
var wrap=jQuery('.isotope_wrap.inited');
if(wrap.length==0) return;
wrap.each(function(){
"use strict";
var alter=jQuery(this).find('.post_item_alter');
if(alter.length==0) return;
var single=alter.find('.post_featured img[data-alter-items-w="1"]').eq(0);
if(single.length!=1) return;
var w_real=single.width();
var h_real=single.height();
var space=Number(single.data('alter-item-space'));
var relayout=false;
alter.find('.post_featured img').each(function(){
"use strict";
var items_w=Number(jQuery(this).data('alter-items-w'));
var items_h=Number(jQuery(this).data('alter-items-h'));
if(items_h > 1){
jQuery(this).height(Math.round(items_h*h_real+(items_h-1)*(space+1)));
relayout=true;
}else if(items_w > 1){
jQuery(this).height(h_real);
relayout=true;
}});
if(relayout){
jQuery(this).isotope('layout');
}});
}
function junotoys_init_sfmenu(selector){
"use strict";
jQuery(selector).show().each(function(){
if(junotoys_is_responsive_need()&&(jQuery(this).attr('id')=='menu_main'||jQuery(this).attr('id')=='menu_side')) return;
jQuery(this).addClass('inited').superfish({
delay: 500,
animation: {
opacity: 'show'
},
animationOut: {
opacity: 'hide'
},
speed: JUNOTOYS_STORAGE['css_animation'] ? 500:200,
speedOut: JUNOTOYS_STORAGE['css_animation'] ? 500:200,
autoArrows: false,
dropShadows: false,
onBeforeShow: function(ul){
if(jQuery(this).parents("ul").length > 1){
var w=jQuery(window).width();
var par_offset=jQuery(this).parents("ul").offset().left;
var par_width=jQuery(this).parents("ul").outerWidth();
var ul_width=jQuery(this).outerWidth();
if(par_offset+par_width+ul_width > w-20&&par_offset-ul_width > 0)
jQuery(this).addClass('submenu_left');
else
jQuery(this).removeClass('submenu_left');
}
if(JUNOTOYS_STORAGE['css_animation']){
jQuery(this).removeClass('animated fast '+JUNOTOYS_STORAGE['menu_animation_out']);
jQuery(this).addClass('animated fast '+JUNOTOYS_STORAGE['menu_animation_in']);
}},
onBeforeHide: function(ul){
if(JUNOTOYS_STORAGE['css_animation']){
jQuery(this).removeClass('animated fast '+JUNOTOYS_STORAGE['menu_animation_in']);
jQuery(this).addClass('animated fast '+JUNOTOYS_STORAGE['menu_animation_out']);
}}
});
});
}
function junotoys_build_page_toc(){
"use strict";
var toc='', toc_count=0;
jQuery('[id^="toc_"],.sc_anchor').each(function(idx){
"use strict";
var obj=jQuery(this);
var id=obj.attr('id');
var url=obj.data('url');
var icon=obj.data('icon');
if(!icon) icon='icon-circle-dot';
var title=obj.attr('title');
var description=obj.data('description');
var separator=obj.data('separator');
toc_count++;
toc +='';
});
if(toc_count > (JUNOTOYS_STORAGE['toc_menu_home'] ? 1:0) + (JUNOTOYS_STORAGE['toc_menu_top'] ? 1:0)){
if(jQuery('#toc').length > 0)
jQuery('#toc .toc_inner').html(toc);
else
jQuery('body').append('');
}}
function junotoys_show_current_menu_item(menu, button){
"use strict";
menu.find('a').each(function (){
var menu_link=jQuery(this);
if(menu_link.text()==""){
return;
}
if(menu_link.attr('href')==window.location.href)
button.text(menu_link.text());
});
}
function junotoys_init_isotope(){
"use strict";
var all_images_complete=true;
jQuery('.isotope_wrap:not(.inited)').each(function (){
"use strict";
all_images_complete=all_images_complete&&junotoys_check_images_complete(jQuery(this));
});
if(!all_images_complete&&JUNOTOYS_STORAGE['isotope_init_counter']++ < 30){
setTimeout(junotoys_init_isotope, 200);
return;
}
jQuery('.isotope_filters:not(.inited)').addClass('inited').on('click', 'a', function(e){
"use strict";
jQuery(this).parents('.isotope_filters').find('a').removeClass('active');
jQuery(this).addClass('active');
var selector=jQuery(this).data('filter');
jQuery(this).parents('.isotope_filters').siblings('.isotope_wrap').eq(0).isotope({
filter: selector
});
if(selector=='*')
jQuery('#viewmore_link').fadeIn();
else
jQuery('#viewmore_link').fadeOut();
e.preventDefault();
return false;
});
jQuery('.isotope_wrap:not(.inited)').each(function(){
"use strict";
var isotope_container=jQuery(this);
junotoys_sc_init(isotope_container);
if(isotope_container.parents('.sc_scroll').length > 0){
isotope_container.addClass('inited').find('.isotope_item').animate({opacity: 1}, 200, function (){ jQuery(this).addClass('isotope_item_show'); });
return;
}
setTimeout(function(){
isotope_container.addClass('inited').isotope({
itemSelector: '.isotope_item',
animationOptions: {
duration: 750,
easing: 'linear',
queue: false
}});
isotope_container.find('.isotope_item').animate({opacity: 1}, 200, function (){
jQuery(this).addClass('isotope_item_show');
});
junotoys_resize_alter_portfolio();
}, 500);
});
}
function junotoys_init_appended_isotope(posts_container, filters){
"use strict";
if(posts_container.parents('.sc_scroll_horizontal').length > 0) return;
if(!junotoys_check_images_complete(posts_container)&&JUNOTOYS_STORAGE['isotope_init_counter']++ < 30){
setTimeout(function(){ junotoys_init_appended_isotope(posts_container, filters); }, 200);
return;
}
var flt=posts_container.siblings('.isotope_filter');
for (var i in filters){
if(flt.find('a[data-filter=".flt_'+i+'"]').length==0){
flt.append(''+filters[i]+' ');
}}
junotoys_sc_init(posts_container);
var elems=posts_container.find('.isotope_item:not(.isotope_item_show)');
setTimeout(function(){
posts_container.isotope('appended', elems);
elems.animate({opacity: 1}, 200, function (){ jQuery(this).addClass('isotope_item_show'); });
}, 500);
}
function junotoys_init_post_formats(){
"use strict";
if(window.junotoys_theme_init_post_formats) junotoys_theme_init_post_formats();
junotoys_init_media_elements(jQuery('body'));
if(jQuery('.isotope_wrap:not(.inited)').length > 0){
JUNOTOYS_STORAGE['isotope_init_counter']=0;
junotoys_init_isotope();
}
if(jQuery('.isotope_wrap .isotope_item_content.square.effect_dir:not(.inited)').length > 0){
jQuery('.isotope_wrap .isotope_item_content.square.effect_dir:not(.inited)').each(function(){
jQuery(this).addClass('inited').hoverdir();
});
}
if(JUNOTOYS_STORAGE['popup_engine']=='pretty'){
jQuery("a[href$='jpg'],a[href$='jpeg'],a[href$='png'],a[href$='gif']").attr('rel', 'prettyPhoto[slideshow]');
var images=jQuery("a[rel*='prettyPhoto']:not(.inited):not(.esgbox):not([data-rel*='pretty']):not([rel*='magnific']):not([data-rel*='magnific'])").addClass('inited');
try {
images.prettyPhoto({
social_tools: '',
theme: 'facebook',
deeplinking: false
});
} catch (e){};}else if(JUNOTOYS_STORAGE['popup_engine']=='magnific'){
jQuery("a[href$='jpg'],a[href$='jpeg'],a[href$='png'],a[href$='gif']").each(function(){
if(!jQuery(this).parent().hasClass('woocommerce-product-gallery__image'))
jQuery(this).attr('rel', 'magnific');
});
var images=jQuery("a[rel*='magnific']:not(.inited):not(.esgbox):not(.prettyphoto):not([rel*='pretty']):not([data-rel*='pretty'])").addClass('inited');
try {
images.magnificPopup({
type: 'image',
mainClass: 'mfp-img-mobile',
closeOnContentClick: true,
closeBtnInside: true,
fixedContentPos: true,
midClick: true,
preloader: true,
tLoading: JUNOTOYS_STORAGE['strings']['magnific_loading'],
gallery:{
enabled: true
},
image: {
tError: JUNOTOYS_STORAGE['strings']['magnific_error'],
verticalFit: true
}});
} catch (e){};}
jQuery(".post_item_product .product .images a.woocommerce-main-image:not(.hover_icon)").addClass('hover_icon hover_icon_view');
if(jQuery('.post_counters_likes:not(.inited)').length > 0){
jQuery('.post_counters_likes:not(.inited)')
.addClass('inited')
.on('click', function(e){
var button=jQuery(this);
var inc=button.hasClass('enabled') ? 1:-1;
var post_id=button.data('postid');
var likes=Number(button.data('likes'))+inc;
var cookie_likes=junotoys_get_cookie('junotoys_likes');
if(cookie_likes===undefined||cookie_likes===null) cookie_likes='';
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'post_counter',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
post_id: post_id,
likes: likes
}).done(function(response){
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: JUNOTOYS_STORAGE['ajax_error'] };
console.log(response);
}
if(rez.error===''){
if(inc==1){
var title=button.data('title-dislike');
button.removeClass('enabled').addClass('disabled');
cookie_likes +=(cookie_likes.substr(-1)!=',' ? ',':'') + post_id + ',';
}else{
var title=button.data('title-like');
button.removeClass('disabled').addClass('enabled');
cookie_likes=cookie_likes.replace(','+post_id+',', ',');
}
button.data('likes', likes).attr('title', title).find('.post_counters_number').html(likes);
junotoys_set_cookie('junotoys_likes', cookie_likes, 365);
}else{
junotoys_message_warning(JUNOTOYS_STORAGE['strings']['error_like']);
}});
e.preventDefault();
return false;
});
}
if(jQuery('.sc_socials_share:not(.inited)').length > 0){
jQuery('.sc_socials_share:not(.inited)').each(function(){
"use strict";
jQuery(this).addClass('inited').on('click', '.social_item_popup > a.social_icons', function(e){
"use strict";
var url=jQuery(this).data('link');
window.open(url, '_blank', 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=480, height=400, toolbar=0, status=0');
e.preventDefault();
return false;
});
});
}
if(jQuery('.sc_video_play_button:not(.inited)').length > 0){
jQuery('.sc_video_play_button:not(.inited)').each(function(){
"use strict";
jQuery(this)
.addClass('inited')
.animate({opacity: 1}, 1000)
.on('click', function (e){
"use strict";
if(!jQuery(this).hasClass('sc_video_play_button')) return;
var video=jQuery(this).removeClass('sc_video_play_button hover_icon hover_icon_play').data('video');
if(video!==''){
jQuery(this).empty().html(video);
junotoys_video_dimensions();
var video_tag=jQuery(this).find('video');
var w=video_tag.width();
var h=video_tag.height();
junotoys_init_media_elements(jQuery(this));
jQuery(this).find('video').css({'width':w, 'height': h}).attr({'width':w, 'height': h});
}
e.preventDefault();
return false;
});
});
}}
function junotoys_init_media_elements(cont){
"use strict";
if(JUNOTOYS_STORAGE['media_elements_enabled']&&cont.find('audio,video').length > 0){
if(window.mejs){
if(typeof window.mejs.MepDefaults!='undefined') window.mejs.MepDefaults.enableAutosize=false;
if(typeof window.mejs.MediaElementDefaults!='undefined') window.mejs.MediaElementDefaults.enableAutosize=false;
cont.find('audio:not(.wp-audio-shortcode),video:not(.wp-video-shortcode)').each(function(){
if(jQuery(this).parents('.mejs-mediaelement').length==0){
var media_tag=jQuery(this);
var settings={
enableAutosize: true,
videoWidth: -1,
videoHeight: -1,
audioWidth: '100%',
audioHeight: 30,
success: function(mejs){
var autoplay, loop;
if('flash'===mejs.pluginType){
autoplay=mejs.attributes.autoplay&&'false'!==mejs.attributes.autoplay;
loop=mejs.attributes.loop&&'false'!==mejs.attributes.loop;
autoplay&&mejs.addEventListener('canplay', function (){
mejs.play();
}, false);
loop&&mejs.addEventListener('ended', function (){
mejs.play();
}, false);
}
media_tag.parents('.sc_audio,.sc_video').addClass('inited sc_show');
}};
jQuery(this).mediaelementplayer(settings);
}});
} else
setTimeout(function(){ junotoys_init_media_elements(cont); }, 400);
}}
function junotoys_show_system_message(){
"use strict";
if(JUNOTOYS_STORAGE['system_message']&&JUNOTOYS_STORAGE['system_message']['message']){
if(JUNOTOYS_STORAGE['system_message']['status']=='success')
junotoys_message_success(JUNOTOYS_STORAGE['system_message']['message'], JUNOTOYS_STORAGE['system_message']['header']);
else if(JUNOTOYS_STORAGE['system_message']['status']=='info')
junotoys_message_info(JUNOTOYS_STORAGE['system_message']['message'], JUNOTOYS_STORAGE['system_message']['header']);
else if(JUNOTOYS_STORAGE['system_message']['status']=='error'||JUNOTOYS_STORAGE['system_message']['status']=='warning')
junotoys_message_warning(JUNOTOYS_STORAGE['system_message']['message'], JUNOTOYS_STORAGE['system_message']['header']);
}}
function junotoys_toggle_popup(popup){
"use strict";
if(popup.css('display')!='none')
junotoys_hide_popup(popup);
else
junotoys_show_popup(popup);
}
function junotoys_show_popup(popup){
"use strict";
if(popup.css('display')=='none'){
if(false&&JUNOTOYS_STORAGE['css_animation'])
popup.show().removeClass('animated fast '+JUNOTOYS_STORAGE['menu_animation_out']).addClass('animated fast '+JUNOTOYS_STORAGE['menu_animation_in']);
else
popup.slideDown();
}}
function junotoys_hide_popup(popup){
"use strict";
if(popup.css('display')!='none'){
if(false&&JUNOTOYS_STORAGE['css_animation'])
popup.removeClass('animated fast '+JUNOTOYS_STORAGE['menu_animation_in']).addClass('animated fast '+JUNOTOYS_STORAGE['menu_animation_out']).delay(500).hide();
else
popup.fadeOut();
}}
function junotoys_comments_validate(form){
"use strict";
form.find('input').removeClass('error_fields_class');
var rules={
error_message_text: JUNOTOYS_STORAGE['strings']['error_global'],
error_message_show: true,
error_message_time: 4000,
error_message_class: 'sc_infobox sc_infobox_style_error',
error_fields_class: 'error_fields_class',
exit_after_first_error: false,
rules: [
{
field: 'comment',
min_length: { value: 1, message: JUNOTOYS_STORAGE['strings']['text_empty'] },
max_length: { value: JUNOTOYS_STORAGE['comments_maxlength'], message: JUNOTOYS_STORAGE['strings']['text_long']}}
]
};
if(form.find('.comments_author input[aria-required="true"]').length > 0){
rules.rules.push({
field: 'author',
min_length: { value: 1, message: JUNOTOYS_STORAGE['strings']['name_empty']},
max_length: { value: 60, message: JUNOTOYS_STORAGE['strings']['name_long']}}
);
}
if(form.find('.comments_email input[aria-required="true"]').length > 0){
rules.rules.push({
field: 'email',
min_length: { value: 7, message: JUNOTOYS_STORAGE['strings']['email_empty']},
max_length: { value: 60, message: JUNOTOYS_STORAGE['strings']['email_long']},
mask: { value: JUNOTOYS_STORAGE['email_mask'], message: JUNOTOYS_STORAGE['strings']['email_not_valid']}}
);
}
var error=junotoys_form_validate(form, rules);
return !error;
}
function junotoys_login_validate(form){
"use strict";
form.find('input').removeClass('error_fields_class');
var error=junotoys_form_validate(form, {
error_message_show: true,
error_message_time: 4000,
error_message_class: 'sc_infobox sc_infobox_style_error',
error_fields_class: 'error_fields_class',
exit_after_first_error: true,
rules: [
{
field: "log",
min_length: { value: 1, message: JUNOTOYS_STORAGE['strings']['login_empty'] },
max_length: { value: 60, message: JUNOTOYS_STORAGE['strings']['login_long'] }},
{
field: "pwd",
min_length: { value: 4, message: JUNOTOYS_STORAGE['strings']['password_empty'] },
max_length: { value: 30, message: JUNOTOYS_STORAGE['strings']['password_long'] }}
]
});
if(!error){
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'login_user',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
remember: form.find('#rememberme').val(),
user_log: form.find('#log').val(),
user_pwd: form.find('#password').val()
}).done(function(response){
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: JUNOTOYS_STORAGE['ajax_error'] };
console.log(response);
}
var result_box=form.find('.result');
if(result_box.length==0) result_box=form.siblings('.result');
if(result_box.length==0) result_box=form.after('
').next('.result');
result_box.toggleClass('sc_infobox_style_error', false).toggleClass('sc_infobox_style_success', false);
if(rez.error===''){
result_box.addClass('sc_infobox sc_infobox_style_success').html(JUNOTOYS_STORAGE['strings']['login_success']);
setTimeout(function(){
location.reload();
}, 3000);
}else{
result_box.addClass('sc_infobox sc_infobox_style_error').html(JUNOTOYS_STORAGE['strings']['login_failed'] + ' ' + rez.error);
}
result_box.fadeIn().delay(3000).fadeOut();
});
}
return false;
}
function junotoys_registration_validate(form){
"use strict";
form.find('input').removeClass('error_fields_class');
var error=junotoys_form_validate(form, {
error_message_show: true,
error_message_time: 4000,
error_message_class: "sc_infobox sc_infobox_style_error",
error_fields_class: "error_fields_class",
exit_after_first_error: true,
rules: [
{
field: "registration_agree",
state: { value: 'checked', message: JUNOTOYS_STORAGE['strings']['not_agree'] },
},
{
field: "registration_username",
min_length: { value: 1, message: JUNOTOYS_STORAGE['strings']['login_empty'] },
max_length: { value: 60, message: JUNOTOYS_STORAGE['strings']['login_long'] }},
{
field: "registration_email",
min_length: { value: 7, message: JUNOTOYS_STORAGE['strings']['email_empty'] },
max_length: { value: 60, message: JUNOTOYS_STORAGE['strings']['email_long'] },
mask: { value: JUNOTOYS_STORAGE['email_mask'], message: JUNOTOYS_STORAGE['strings']['email_not_valid'] }},
{
field: "registration_pwd",
min_length: { value: 4, message: JUNOTOYS_STORAGE['strings']['password_empty'] },
max_length: { value: 30, message: JUNOTOYS_STORAGE['strings']['password_long'] }},
{
field: "registration_pwd2",
equal_to: { value: 'registration_pwd', message: JUNOTOYS_STORAGE['strings']['password_not_equal'] }}
]
});
if(!error){
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'registration_user',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
user_name: form.find('#registration_username').val(),
user_email: form.find('#registration_email').val(),
user_pwd: form.find('#registration_pwd').val()
}).done(function(response){
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: JUNOTOYS_STORAGE['ajax_error'] };
console.log(response);
}
var result_box=form.find('.result');
if(result_box.length==0) result_box=form.siblings('.result');
if(result_box.length==0) result_box=form.after('
').next('.result');
result_box.toggleClass('sc_infobox_style_error', false).toggleClass('sc_infobox_style_success', false);
if(rez.error===''){
result_box.addClass('sc_infobox sc_infobox_style_success').html(JUNOTOYS_STORAGE['strings']['registration_success']);
setTimeout(function(){
jQuery('.popup_login_link').trigger('click');
}, 3000);
}else{
result_box.addClass('sc_infobox sc_infobox_style_error').html(JUNOTOYS_STORAGE['strings']['registration_failed'] + ' ' + rez.error);
}
result_box.fadeIn().delay(3000).fadeOut();
});
}
return false;
}
jQuery('a').filter(function(){
"use strict";
return this.hostname&&this.hostname!==location.hostname;
}).attr('target','_blank');
function junotoys_theme_ready_actions(){
"use strict";
if(jQuery('#mega_main_menu').length > 0){
jQuery('body').addClass('body_mega_menu')
}}
function junotoys_theme_scroll_actions(){
"use strict";
}
function junotoys_theme_resize_actions(){
"use strict";
}
function junotoys_theme_sc_init(cont){
"use strict";
}
function junotoys_theme_init_post_formats(){
"use strict";
jQuery('a.tribe-events-read-more,.tribe-events-button,.tribe-events-nav-previous a,.tribe-events-nav-next a,.tribe-events-widget-link a,.tribe-events-viewmore a')
.addClass('sc_button sc_button_style_filled');
if(JUNOTOYS_STORAGE['button_hover']&&JUNOTOYS_STORAGE['button_hover']!='default'){
jQuery('button:not(.search_submit):not([class*="sc_button_hover_"]),\
.sc_button:not(.sc_button_style_border):not([class*="sc_button_hover_"]),\
.woocommerce .button:not([class*="sc_button_hover_"]),.woocommerce-page .button:not([class*="sc_button_hover_"]),\
#buddypress a.button:not([class*="sc_button_hover_"])'
).addClass('sc_button_hover_'+JUNOTOYS_STORAGE['button_hover']);
if(JUNOTOYS_STORAGE['button_hover']!='arrow')
jQuery('input[type="submit"]:not([class*="sc_button_hover_"]),\
input[type="button"]:not([class*="sc_button_hover_"]),\
.isotope_filters_button,\
.scroll_to_top:not([class*="sc_button_hover_"]),\
.sc_slider_prev:not([class*="sc_button_hover_"]),.sc_slider_next:not([class*="sc_button_hover_"]),\
.tagcloud > a:not([class*="sc_button_hover_"])'
).addClass('sc_button_hover_'+JUNOTOYS_STORAGE['button_hover']);
}
jQuery('[class*="sc_input_hover_"] input, [class*="sc_input_hover_"] textarea').each(function(){
if(jQuery(this).val()!='')
jQuery(this).addClass('filled');
else
jQuery(this).removeClass('filled');
});
jQuery('[class*="sc_input_hover_"] input, [class*="sc_input_hover_"] textarea').on('keypress', function(){
if(jQuery(this).val()!='')
jQuery(this).addClass('filled');
else
jQuery(this).removeClass('filled');
});
}
function junotoys_theme_googlemap_styles($styles){
"use strict";
$styles['greyscale']=[
{ "stylers": [
{ "saturation": -100 }
]
}
];
$styles['inverse']=[
{ "stylers": [
{ "invert_lightness": true },
{ "visibility": "on" }
]
}
];
$styles['simple']=[
{ stylers: [
{ hue: "#00ffe6" },
{ saturation: -20 }
]
},
{ featureType: "road",
elementType: "geometry",
stylers: [
{ lightness: 100 },
{ visibility: "simplified" }
]
},
{ featureType: "road",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
];
$styles['apple']=[
{ "featureType": "landscape.man_made",
"elementType": "geometry",
"stylers": [
{"color":"#f7f1df"}
]
},
{ "featureType": "landscape.natural",
"elementType": "geometry",
"stylers": [
{"color":"#d0e3b4"}
]
},
{ "featureType": "landscape.natural.terrain",
"elementType": "geometry",
"stylers": [
{"visibility":"off"}
]
},
{ "featureType": "poi",
"elementType": "labels",
"stylers": [
{"visibility":"off"}
]
},
{ "featureType": "poi.business",
"elementType": "all",
"stylers": [
{"visibility":"off"}
]
},
{ "featureType": "poi.medical",
"elementType": "geometry",
"stylers": [
{"color":"#fbd3da"}
]
},
{ "featureType": "poi.park",
"elementType": "geometry",
"stylers": [
{"color":"#bde6ab"}
]
},
{ "featureType": "road",
"elementType": "geometry.stroke",
"stylers": [
{"visibility":"off"}
]
},
{ "featureType": "road",
"elementType": "labels",
"stylers": [
{"visibility":"off"}
]
},
{ "featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [
{"color":"#ffe15f"}
]
},
{ "featureType": "road.highway",
"elementType":"geometry.stroke",
"stylers": [
{"color":"#efd151"}
]
},
{ "featureType": "road.arterial",
"elementType": "geometry.fill",
"stylers": [
{"color":"#ffffff"}
]
},
{ "featureType": "road.local",
"elementType": "geometry.fill",
"stylers": [
{"color":"black"}
]
},
{ "featureType": "transit.station.airport",
"elementType": "geometry.fill",
"stylers": [
{"color":"#cfb2db"}
]
},
{ "featureType": "water",
"elementType": "geometry",
"stylers": [
{"color":"#a2daf2"}
]
}
];
return $styles;
};
!function r(a,s,l){function d(n,e){if(!s[n]){if(!a[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(u)return u(n,!0);var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}var i=s[n]={exports:{}};a[n][0].call(i.exports,function(e){var t=a[n][1][e];return d(t||e)},i,i.exports,r,a,s,l)}return s[n].exports}for(var u="function"==typeof require&&require,e=0;e',o.addControlElement(t,"fullscreen"),t.addEventListener("click",function(){m.HAS_TRUE_NATIVE_FULLSCREEN&&m.IS_FULLSCREEN||n.isFullScreen?n.exitFullScreen():n.enterFullScreen()}),n.fullscreenBtn=t,o.options.keyActions.push({keys:[70],action:function(e,t,n,o){o.ctrlKey||void 0!==e.enterFullScreen&&(e.isFullScreen?e.exitFullScreen():e.enterFullScreen())}}),o.exitFullscreenCallback=function(e){var t=e.which||e.keyCode||0;o.options.enableKeyboard&&27===t&&(m.HAS_TRUE_NATIVE_FULLSCREEN&&m.IS_FULLSCREEN||o.isFullScreen)&&n.exitFullScreen()},o.globalBind("keydown",o.exitFullscreenCallback),o.normalHeight=0,o.normalWidth=0,m.HAS_TRUE_NATIVE_FULLSCREEN){n.globalBind(m.FULLSCREEN_EVENT_NAME,function(){n.isFullScreen&&(m.isFullScreen()?(n.isNativeFullScreen=!0,n.setControlsSize()):(n.isNativeFullScreen=!1,n.exitFullScreen()))})}}},cleanfullscreen:function(e){e.exitFullScreen(),e.globalUnbind("keydown",e.exitFullscreenCallback)},detectFullscreenMode:function(){var e=null!==this.media.rendererName&&/(native|html5)/i.test(this.media.rendererName),t="";return m.HAS_TRUE_NATIVE_FULLSCREEN&&e?t="native-native":m.HAS_TRUE_NATIVE_FULLSCREEN&&!e?t="plugin-native":this.usePluginFullScreen&&m.SUPPORT_POINTER_EVENTS&&(t="plugin-click"),this.fullscreenMode=t},enterFullScreen:function(){var o=this,e=null!==o.media.rendererName&&/(html5|native)/i.test(o.media.rendererName),t=getComputedStyle(o.getElement(o.container));if(o.isVideo)if(!1===o.options.useFakeFullscreen&&m.IS_IOS&&m.HAS_IOS_FULLSCREEN&&"function"==typeof o.media.originalNode.webkitEnterFullscreen&&o.media.originalNode.canPlayType((0,g.getTypeFromFile)(o.media.getSrc())))o.media.originalNode.webkitEnterFullscreen();else{if((0,v.addClass)(p.default.documentElement,o.options.classPrefix+"fullscreen"),(0,v.addClass)(o.getElement(o.container),o.options.classPrefix+"container-fullscreen"),o.normalHeight=parseFloat(t.height),o.normalWidth=parseFloat(t.width),"native-native"!==o.fullscreenMode&&"plugin-native"!==o.fullscreenMode||(m.requestFullScreen(o.getElement(o.container)),o.isInIframe&&setTimeout(function e(){if(o.isNativeFullScreen){var t=f.default.innerWidth||p.default.documentElement.clientWidth||p.default.body.clientWidth,n=screen.width;.002*n',l.addEventListener("click",function(){i.paused?i.play():i.pause()});var d=l.querySelector("button");function u(e){"play"===e?((0,m.removeClass)(l,i.options.classPrefix+"play"),(0,m.removeClass)(l,i.options.classPrefix+"replay"),(0,m.addClass)(l,i.options.classPrefix+"pause"),d.setAttribute("title",s),d.setAttribute("aria-label",s)):((0,m.removeClass)(l,i.options.classPrefix+"pause"),(0,m.removeClass)(l,i.options.classPrefix+"replay"),(0,m.addClass)(l,i.options.classPrefix+"play"),d.setAttribute("title",a),d.setAttribute("aria-label",a))}i.addControlElement(l,"playpause"),u("pse"),o.addEventListener("loadedmetadata",function(){-1===o.rendererName.indexOf("flash")&&u("pse")}),o.addEventListener("play",function(){u("play")}),o.addEventListener("playing",function(){u("play")}),o.addEventListener("pause",function(){u("pse")}),o.addEventListener("ended",function(){e.options.loop||((0,m.removeClass)(l,i.options.classPrefix+"pause"),(0,m.removeClass)(l,i.options.classPrefix+"play"),(0,m.addClass)(l,i.options.classPrefix+"replay"),d.setAttribute("title",a),d.setAttribute("aria-label",a))})}})},{16:16,2:2,26:26,27:27,5:5}],11:[function(e,t,n){"use strict";var p=r(e(2)),o=e(16),i=r(o),m=r(e(5)),y=e(25),E=e(30),b=e(26);function r(e){return e&&e.__esModule?e:{default:e}}Object.assign(o.config,{enableProgressTooltip:!0,useSmoothHover:!0,forceLive:!1}),Object.assign(i.default.prototype,{buildprogress:function(h,s,e,d){var u=0,v=!1,c=!1,g=this,t=h.options.autoRewind,n=h.options.enableProgressTooltip?'00:00 ':"",o=p.default.createElement("div");o.className=g.options.classPrefix+"time-rail",o.innerHTML=' '+n+" ",g.addControlElement(o,"progress"),g.options.keyActions.push({keys:[37,227],action:function(e){if(!isNaN(e.duration)&&0o+n.left&&(d=o+n.left),a=(l=d-n.left)/o,g.newTime=a*g.getDuration(),v&&null!==g.getCurrentTime()&&g.newTime.toFixed(4)!==g.getCurrentTime().toFixed(4)&&(g.setCurrentRailHandle(g.newTime),g.updateCurrent(g.newTime)),!y.IS_IOS&&!y.IS_ANDROID){if(l<0&&(l=0),g.options.useSmoothHover&&null!==r&&void 0!==window[r]){var u=new window[r](getComputedStyle(g.handle)[i]).m41,c=l/parseFloat(getComputedStyle(g.total).width)-u/parseFloat(getComputedStyle(g.total).width);g.hovered.style.left=u+"px",g.setTransformStyle(g.hovered,"scaleX("+c+")"),g.hovered.setAttribute("pos",l),0<=c?(0,b.removeClass)(g.hovered,"negative"):(0,b.addClass)(g.hovered,"negative")}if(g.timefloat){var f=g.timefloat.offsetWidth/2,p=mejs.Utils.offset(g.getElement(g.container)),m=getComputedStyle(g.timefloat);s=d-p.left=g.getElement(g.container).offsetWidth-f?g.total.offsetWidth-f:l,(0,b.hasClass)(g.getElement(g.container),g.options.classPrefix+"long-video")&&(s+=parseFloat(m.marginLeft)/2+g.timefloat.offsetWidth/2),g.timefloat.style.left=s+"px",g.timefloatcurrent.innerHTML=(0,E.secondsToTimeCode)(g.newTime,h.options.alwaysShowHours,h.options.showTimecodeFrameCount,h.options.framesPerSecond,h.options.secondsDecimalLength,h.options.timeFormat),g.timefloat.style.display="block"}}}else y.IS_IOS||y.IS_ANDROID||!g.timefloat||(s=g.timefloat.offsetWidth+o>=g.getElement(g.container).offsetWidth?g.timefloat.offsetWidth/2:0,g.timefloat.style.left=s+"px",g.timefloat.style.left=s+"px",g.timefloat.style.display="block")},f=function(){1e3<=new Date-u&&g.play()};g.slider.addEventListener("focus",function(){h.options.autoRewind=!1}),g.slider.addEventListener("blur",function(){h.options.autoRewind=t}),g.slider.addEventListener("keydown",function(e){if(1e3<=new Date-u&&(c=g.paused),g.options.enableKeyboard&&g.options.keyActions.length){var t=e.which||e.keyCode||0,n=g.getDuration(),o=h.options.defaultSeekForwardInterval(d),i=h.options.defaultSeekBackwardInterval(d),r=g.getCurrentTime(),a=g.getElement(g.container).querySelector("."+g.options.classPrefix+"volume-slider");if(38===t||40===t){a&&(a.style.display="block"),g.isVideo&&(g.showControls(),g.startControlsTimer());var s=38===t?Math.min(g.volume+.1,1):Math.max(g.volume-.1,0),l=s<=0;return g.setVolume(s),void g.setMuted(l)}switch(a&&(a.style.display="none"),t){case 37:g.getDuration()!==1/0&&(r-=i);break;case 39:g.getDuration()!==1/0&&(r+=o);break;case 36:r=0;break;case 35:r=n;break;case 13:case 32:return void(y.IS_FIREFOX&&(g.paused?g.play():g.pause()));default:return}r=r<0||isNaN(r)?0:n<=r?n:Math.floor(r),u=new Date,c||h.pause(),setTimeout(function(){g.setCurrentTime(r)},0),r | "}),Object.assign(i.default.prototype,{buildcurrent:function(e,t,n,o){var i=this,r=a.default.createElement("div");r.className=i.options.classPrefix+"time",r.setAttribute("role","timer"),r.setAttribute("aria-live","off"),r.innerHTML=''+(0,s.secondsToTimeCode)(0,e.options.alwaysShowHours,e.options.showTimecodeFrameCount,e.options.framesPerSecond,e.options.secondsDecimalLength,e.options.timeFormat)+" ",i.addControlElement(r,"current"),e.updateCurrent(),i.updateTimeCallback=function(){i.controlsAreVisible&&e.updateCurrent()},o.addEventListener("timeupdate",i.updateTimeCallback)},cleancurrent:function(e,t,n,o){o.removeEventListener("timeupdate",e.updateTimeCallback)},buildduration:function(e,t,n,o){var i=this;if(t.lastChild.querySelector("."+i.options.classPrefix+"currenttime"))t.querySelector("."+i.options.classPrefix+"time").innerHTML+=i.options.timeAndDurationSeparator+''+(0,s.secondsToTimeCode)(i.options.duration,i.options.alwaysShowHours,i.options.showTimecodeFrameCount,i.options.framesPerSecond,i.options.secondsDecimalLength,i.options.timeFormat)+" ";else{t.querySelector("."+i.options.classPrefix+"currenttime")&&(0,l.addClass)(t.querySelector("."+i.options.classPrefix+"currenttime").parentNode,i.options.classPrefix+"currenttime-container");var r=a.default.createElement("div");r.className=i.options.classPrefix+"time "+i.options.classPrefix+"duration-container",r.innerHTML=''+(0,s.secondsToTimeCode)(i.options.duration,i.options.alwaysShowHours,i.options.showTimecodeFrameCount,i.options.framesPerSecond,i.options.secondsDecimalLength,i.options.timeFormat)+" ",i.addControlElement(r,"duration")}i.updateDurationCallback=function(){i.controlsAreVisible&&e.updateDuration()},o.addEventListener("timeupdate",i.updateDurationCallback)},cleanduration:function(e,t,n,o){o.removeEventListener("timeupdate",e.updateDurationCallback)},updateCurrent:function(){var e=this,t=e.getCurrentTime();isNaN(t)&&(t=0);var n=(0,s.secondsToTimeCode)(t,e.options.alwaysShowHours,e.options.showTimecodeFrameCount,e.options.framesPerSecond,e.options.secondsDecimalLength,e.options.timeFormat);5 ',o.captions.style.display="none",t.insertBefore(o.captions,t.firstChild),o.captionsText=o.captions.querySelector("."+i.options.classPrefix+"captions-text"),o.captionsButton=L.default.createElement("div"),o.captionsButton.className=i.options.classPrefix+"button "+i.options.classPrefix+"captions-button",o.captionsButton.innerHTML=' ",i.addControlElement(o.captionsButton,"tracks"),o.captionsButton.querySelector("."+i.options.classPrefix+"captions-selector-input").disabled=!1,o.chaptersButton=L.default.createElement("div"),o.chaptersButton.className=i.options.classPrefix+"button "+i.options.classPrefix+"chapters-button",o.chaptersButton.innerHTML=' ';for(var u=0,c=0;c'+n+" (loading) "},checkForTracks:function(){var e=this,t=!1;if(e.options.hideCaptionsButtonWhenEmpty){for(var n=0,o=e.tracks.length;n'+e.entries[n].text+" ";for(var o=r.chaptersButton.querySelectorAll('input[type="radio"]'),i=r.chaptersButton.querySelectorAll("."+r.options.classPrefix+"chapters-selector-label"),a=0,s=o.length;a>1].start,a=e[i].stop,r<=t&&t ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(e){for(var t=e.split(/\r?\n/),n=[],o=void 0,i=void 0,r=void 0,a=0,s=t.length;a$1 "),n.push({identifier:r,start:0===(0,m.convertSMPTEtoSeconds)(o[1])?.2:(0,m.convertSMPTEtoSeconds)(o[1]),stop:(0,m.convertSMPTEtoSeconds)(o[3]),text:i,settings:o[5]})}r=""}return n}},dfxp:{parse:function(e){var t=(e=$(e).filter("tt")).firstChild,n=t.querySelectorAll("p"),o=e.getElementById(""+t.attr("style")),i=[],r=void 0;if(o.length){o.removeAttribute("id");var a=o.attributes;if(a.length){r={};for(var s=0,l=a.length;s$1"),i.push(f)}return i}}}},{16:16,2:2,26:26,27:27,30:30,5:5,7:7}],14:[function(e,t,n){"use strict";var x=r(e(2)),o=e(16),i=r(o),w=r(e(5)),P=e(25),T=e(27),C=e(26);function r(e){return e&&e.__esModule?e:{default:e}}Object.assign(o.config,{muteText:null,unmuteText:null,allyVolumeControlText:null,hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical",startVolume:.8}),Object.assign(i.default.prototype,{buildvolume:function(e,t,n,o){if(!P.IS_ANDROID&&!P.IS_IOS||!this.options.hideVolumeOnTouchDevices){var a=this,s=a.isVideo?a.options.videoVolume:a.options.audioVolume,r=(0,T.isString)(a.options.muteText)?a.options.muteText:w.default.t("mejs.mute"),l=(0,T.isString)(a.options.unmuteText)?a.options.unmuteText:w.default.t("mejs.unmute"),i=(0,T.isString)(a.options.allyVolumeControlText)?a.options.allyVolumeControlText:w.default.t("mejs.volume-help-text"),d=x.default.createElement("div");if(d.className=a.options.classPrefix+"button "+a.options.classPrefix+"volume-button "+a.options.classPrefix+"mute",d.innerHTML="horizontal"===s?' ':''+i+' ',a.addControlElement(d,"volume"),a.options.keyActions.push({keys:[38],action:function(e){var t=e.getElement(e.container).querySelector("."+a.options.classPrefix+"volume-slider");t&&t.matches(":focus")&&(t.style.display="block"),e.isVideo&&(e.showControls(),e.startControlsTimer());var n=Math.min(e.volume+.1,1);e.setVolume(n),0'+i+'',d.parentNode.insertBefore(u,d.nextSibling)}var c=!1,f=!1,p=!1,m="vertical"===s?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-slider"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-slider"),h="vertical"===s?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-total"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-total"),v="vertical"===s?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-current"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-current"),g="vertical"===s?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-handle"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-handle"),y=function(e){if(null!==e&&!isNaN(e)&&void 0!==e){if(e=Math.max(0,e),0===(e=Math.min(e,1))){(0,C.removeClass)(d,a.options.classPrefix+"mute"),(0,C.addClass)(d,a.options.classPrefix+"unmute");var t=d.firstElementChild;t.setAttribute("title",l),t.setAttribute("aria-label",l)}else{(0,C.removeClass)(d,a.options.classPrefix+"unmute"),(0,C.addClass)(d,a.options.classPrefix+"mute");var n=d.firstElementChild;n.setAttribute("title",r),n.setAttribute("aria-label",r)}var o=100*e+"%",i=getComputedStyle(g);"vertical"===s?(v.style.bottom=0,v.style.height=o,g.style.bottom=o,g.style.marginBottom=-parseFloat(i.height)/2+"px"):(v.style.left=0,v.style.width=o,g.style.left=o,g.style.marginLeft=-parseFloat(i.width)/2+"px")}},E=function(e){var t=(0,C.offset)(h),n=getComputedStyle(h);p=!0;var o=null;if("vertical"===s){var i=parseFloat(n.height);if(o=(i-(e.pageY-t.top))/i,0===t.top||0===t.left)return}else{var r=parseFloat(n.width);o=(e.pageX-t.left)/r}o=Math.max(0,o),o=Math.min(o,1),y(o),a.setMuted(0===o),a.setVolume(o),e.preventDefault(),e.stopPropagation()},b=function(){a.muted?(y(0),(0,C.removeClass)(d,a.options.classPrefix+"mute"),(0,C.addClass)(d,a.options.classPrefix+"unmute")):(y(o.volume),(0,C.removeClass)(d,a.options.classPrefix+"unmute"),(0,C.addClass)(d,a.options.classPrefix+"mute"))};e.getElement(e.container).addEventListener("keydown",function(e){!!e.target.closest("."+a.options.classPrefix+"container")||"vertical"!==s||(m.style.display="none")}),d.addEventListener("mouseenter",function(e){e.target===d&&(m.style.display="block",f=!0,e.preventDefault(),e.stopPropagation())}),d.addEventListener("focusin",function(){m.style.display="block",f=!0}),d.addEventListener("focusout",function(e){e.relatedTarget&&(!e.relatedTarget||e.relatedTarget.matches("."+a.options.classPrefix+"volume-slider"))||"vertical"!==s||(m.style.display="none")}),d.addEventListener("mouseleave",function(){f=!1,c||"vertical"!==s||(m.style.display="none")}),d.addEventListener("focusout",function(){f=!1}),d.addEventListener("keydown",function(e){if(a.options.enableKeyboard&&a.options.keyActions.length){var t=e.which||e.keyCode||0,n=o.volume;switch(t){case 38:n=Math.min(n+.1,1);break;case 40:n=Math.max(0,n-.1);break;default:return!0}c=!1,y(n),o.setVolume(n),e.preventDefault(),e.stopPropagation()}}),d.querySelector("button").addEventListener("click",function(){o.setMuted(!o.muted);var e=(0,T.createEvent)("volumechange",o);o.dispatchEvent(e)}),m.addEventListener("dragstart",function(){return!1}),m.addEventListener("mouseover",function(){f=!0}),m.addEventListener("focusin",function(){m.style.display="block",f=!0}),m.addEventListener("focusout",function(){f=!1,c||"vertical"!==s||(m.style.display="none")}),m.addEventListener("mousedown",function(e){E(e),a.globalBind("mousemove.vol",function(e){var t=e.target;c&&(t===m||t.closest("vertical"===s?"."+a.options.classPrefix+"volume-slider":"."+a.options.classPrefix+"horizontal-volume-slider"))&&E(e)}),a.globalBind("mouseup.vol",function(){c=!1,f||"vertical"!==s||(m.style.display="none")}),c=!0,e.preventDefault(),e.stopPropagation()}),o.addEventListener("volumechange",function(e){var t;c||b(),t=Math.floor(100*o.volume),m.setAttribute("aria-valuenow",t),m.setAttribute("aria-valuetext",t+"%")});var S=!1;o.addEventListener("rendererready",function(){p||setTimeout(function(){S=!0,(0===e.options.startVolume||o.originalNode.muted)&&(o.setMuted(!0),e.options.startVolume=0),o.setVolume(e.options.startVolume),a.setControlsSize()},250)}),o.addEventListener("loadedmetadata",function(){setTimeout(function(){p||S||((0===e.options.startVolume||o.originalNode.muted)&&o.setMuted(!0),o.setVolume(e.options.startVolume),a.setControlsSize()),S=!1},250)}),(0===e.options.startVolume||o.originalNode.muted)&&(o.setMuted(!0),e.options.startVolume=0,b()),a.getElement(a.container).addEventListener("controlsresize",function(){b()})}}})},{16:16,2:2,25:25,26:26,27:27,5:5}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.EN={"mejs.plural-form":1,"mejs.download-file":"Download File","mejs.install-flash":"You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/","mejs.fullscreen":"Fullscreen","mejs.play":"Play","mejs.pause":"Pause","mejs.time-slider":"Time Slider","mejs.time-help-text":"Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.","mejs.live-broadcast":"Live Broadcast","mejs.volume-help-text":"Use Up/Down Arrow keys to increase or decrease volume.","mejs.unmute":"Unmute","mejs.mute":"Mute","mejs.volume-slider":"Volume Slider","mejs.video-player":"Video Player","mejs.audio-player":"Audio Player","mejs.captions-subtitles":"Captions/Subtitles","mejs.captions-chapters":"Chapters","mejs.none":"None","mejs.afrikaans":"Afrikaans","mejs.albanian":"Albanian","mejs.arabic":"Arabic","mejs.belarusian":"Belarusian","mejs.bulgarian":"Bulgarian","mejs.catalan":"Catalan","mejs.chinese":"Chinese","mejs.chinese-simplified":"Chinese (Simplified)","mejs.chinese-traditional":"Chinese (Traditional)","mejs.croatian":"Croatian","mejs.czech":"Czech","mejs.danish":"Danish","mejs.dutch":"Dutch","mejs.english":"English","mejs.estonian":"Estonian","mejs.filipino":"Filipino","mejs.finnish":"Finnish","mejs.french":"French","mejs.galician":"Galician","mejs.german":"German","mejs.greek":"Greek","mejs.haitian-creole":"Haitian Creole","mejs.hebrew":"Hebrew","mejs.hindi":"Hindi","mejs.hungarian":"Hungarian","mejs.icelandic":"Icelandic","mejs.indonesian":"Indonesian","mejs.irish":"Irish","mejs.italian":"Italian","mejs.japanese":"Japanese","mejs.korean":"Korean","mejs.latvian":"Latvian","mejs.lithuanian":"Lithuanian","mejs.macedonian":"Macedonian","mejs.malay":"Malay","mejs.maltese":"Maltese","mejs.norwegian":"Norwegian","mejs.persian":"Persian","mejs.polish":"Polish","mejs.portuguese":"Portuguese","mejs.romanian":"Romanian","mejs.russian":"Russian","mejs.serbian":"Serbian","mejs.slovak":"Slovak","mejs.slovenian":"Slovenian","mejs.spanish":"Spanish","mejs.swahili":"Swahili","mejs.swedish":"Swedish","mejs.tagalog":"Tagalog","mejs.thai":"Thai","mejs.turkish":"Turkish","mejs.ukrainian":"Ukrainian","mejs.vietnamese":"Vietnamese","mejs.welsh":"Welsh","mejs.yiddish":"Yiddish"}},{}],16:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.config=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function o(e,t){for(var n=0;n
',n.getElement(n.container).addEventListener("focus",function(e){if(!n.controlsAreVisible&&!n.hasFocus&&n.controlsEnabled){n.showControls(!0);var t=(0,m.isNodeAfter)(e.relatedTarget,n.getElement(n.container))?"."+n.options.classPrefix+"controls ."+n.options.classPrefix+"button:last-child > button":"."+n.options.classPrefix+"playpause-button > button";n.getElement(n.container).querySelector(t).focus()}}),n.node.parentNode.insertBefore(n.getElement(n.container),n.node),n.options.features.length||n.options.useDefaultControls||(n.getElement(n.container).style.background="transparent",n.getElement(n.container).querySelector("."+n.options.classPrefix+"controls").style.display="none"),n.isVideo&&"fill"===n.options.stretching&&!P.hasClass(n.getElement(n.container).parentNode,n.options.classPrefix+"fill-container")){n.outerContainer=n.media.parentNode;var r=x.default.createElement("div");r.className=n.options.classPrefix+"fill-container",n.getElement(n.container).parentNode.insertBefore(r,n.getElement(n.container)),r.appendChild(n.getElement(n.container))}w.IS_ANDROID&&P.addClass(n.getElement(n.container),n.options.classPrefix+"android"),w.IS_IOS&&P.addClass(n.getElement(n.container),n.options.classPrefix+"ios"),w.IS_IPAD&&P.addClass(n.getElement(n.container),n.options.classPrefix+"ipad"),w.IS_IPHONE&&P.addClass(n.getElement(n.container),n.options.classPrefix+"iphone"),P.addClass(n.getElement(n.container),n.isVideo?n.options.classPrefix+"video":n.options.classPrefix+"audio"),n.getElement(n.container).querySelector("."+n.options.classPrefix+"mediaelement").appendChild(n.node),(n.media.player=n).controls=n.getElement(n.container).querySelector("."+n.options.classPrefix+"controls"),n.layers=n.getElement(n.container).querySelector("."+n.options.classPrefix+"layers");var a=n.isVideo?"video":"audio",s=a.substring(0,1).toUpperCase()+a.substring(1);0=n.width?n.width/n.height:n.height/n.width,n.setPlayerSize(n.width,n.height),e.pluginWidth=n.width,e.pluginHeight=n.height}if(f.default.MepDefaults=e,new d.default(n.media,e,n.mediaFiles),void 0!==n.getElement(n.container)&&n.options.features.length&&n.controlsAreVisible&&!n.options.hideVideoControlsOnLoad){var l=(0,m.createEvent)("controlsshown",n.getElement(n.container));n.getElement(n.container).dispatchEvent(l)}}},{key:"showControls",value:function(e){var i=this;if(e=void 0===e||e,!i.controlsAreVisible&&i.isVideo){if(e)!function(){P.fadeIn(i.getElement(i.controls),200,function(){P.removeClass(i.getElement(i.controls),i.options.classPrefix+"offscreen");var e=(0,m.createEvent)("controlsshown",i.getElement(i.container));i.getElement(i.container).dispatchEvent(e)});for(var n=i.getElement(i.container).querySelectorAll("."+i.options.classPrefix+"control"),e=function(e,t){P.fadeIn(n[e],200,function(){P.removeClass(n[e],i.options.classPrefix+"offscreen")})},t=0,o=n.length;t'),e.message&&(a=""+e.message+"
"),e.urls)for(var d=0,u=e.urls.length;d'+f.default.i18n.t("mejs.download-file")+": "+c.src+" "}}a&&o.getElement(o.layers).querySelector("."+o.options.classPrefix+"overlay-error")&&(r.innerHTML=a,o.getElement(o.layers).querySelector("."+o.options.classPrefix+"overlay-error").innerHTML=""+s+r.outerHTML,o.getElement(o.layers).querySelector("."+o.options.classPrefix+"overlay-error").parentNode.style.display="block"),o.controlsEnabled&&o.disableControls()}},{key:"setPlayerSize",value:function(e,t){var n=this;if(!n.options.setDimensions)return!1;switch(void 0!==e&&(n.width=e),void 0!==t&&(n.height=t),n.options.stretching){case"fill":n.isVideo?n.setFillMode():n.setDimensions(n.width,n.height);break;case"responsive":n.setResponsiveMode();break;case"none":n.setDimensions(n.width,n.height);break;default:!0===n.hasFluidMode()?n.setResponsiveMode():n.setDimensions(n.width,n.height)}}},{key:"hasFluidMode",value:function(){var e=this;return-1!==e.height.toString().indexOf("%")||e.node&&e.node.style.maxWidth&&"none"!==e.node.style.maxWidth&&e.node.style.maxWidth!==e.width||e.node&&e.node.currentStyle&&"100%"===e.node.currentStyle.maxWidth}},{key:"setResponsiveMode",value:function(){var e,o=this,t=function(){for(var t=void 0,n=o.getElement(o.container);n;){try{if(w.IS_FIREFOX&&"html"===n.tagName.toLowerCase()&&S.default.self!==S.default.top&&null!==S.default.frameElement)return S.default.frameElement;t=n.parentElement}catch(e){t=n.parentElement}if(t&&P.visible(t))return t;n=t}return null}(),n=t?getComputedStyle(t,null):getComputedStyle(x.default.body,null),i=o.isVideo?o.node.videoWidth&&0=o.width?o.node.videoWidth/o.node.videoHeight:o.node.videoHeight/o.node.videoWidth:o.initialAspectRatio,(isNaN(e)||e<.01||100=o.width?parseFloat(d/a,10):parseFloat(d*a,10):r,isNaN(l)&&(l=s),0img");a&&(a.style.display="");for(var s=e.getElement(e.container).querySelectorAll("object, embed, iframe, video"),l=e.height,d=e.width,u=i,c=l*i/d,f=d*r/l,p=r,m=i ',n.appendChild(r),a.style.display="none",a.className=i.options.classPrefix+"overlay "+i.options.classPrefix+"layer",a.innerHTML='
',n.appendChild(a),s.className=i.options.classPrefix+"overlay "+i.options.classPrefix+"layer "+i.options.classPrefix+"overlay-play",s.innerHTML='
',s.addEventListener("click",function(){if(i.options.clickToPlayPause){var e=i.getElement(i.container).querySelector("."+i.options.classPrefix+"overlay-button"),t=e.getAttribute("aria-pressed");i.paused?i.play():i.pause(),e.setAttribute("aria-pressed",!!t),i.getElement(i.container).focus()}}),s.addEventListener("keydown",function(e){var t=e.keyCode||e.which||0;if(13===t||w.IS_FIREFOX&&32===t){var n=(0,m.createEvent)("click",s);return s.dispatchEvent(n),!1}}),n.appendChild(s),null!==i.media.rendererName&&(/(youtube|facebook)/i.test(i.media.rendererName)&&!(i.media.originalNode.getAttribute("poster")||t.options.poster||"function"==typeof i.media.renderer.getPosterUrl&&i.media.renderer.getPosterUrl())||w.IS_STOCK_ANDROID||i.media.originalNode.getAttribute("autoplay"))&&(s.style.display="none");var l=!1;o.addEventListener("play",function(){s.style.display="none",r.style.display="none",a.style.display="none",l=!1}),o.addEventListener("playing",function(){s.style.display="none",r.style.display="none",a.style.display="none",l=!1}),o.addEventListener("seeking",function(){s.style.display="none",r.style.display="",l=!1}),o.addEventListener("seeked",function(){s.style.display=i.paused&&!w.IS_STOCK_ANDROID?"":"none",r.style.display="none",l=!1}),o.addEventListener("pause",function(){r.style.display="none",w.IS_STOCK_ANDROID||l||(s.style.display=""),l=!1}),o.addEventListener("waiting",function(){r.style.display="",l=!1}),o.addEventListener("loadeddata",function(){r.style.display="",w.IS_ANDROID&&(o.canplayTimeout=setTimeout(function(){if(x.default.createEvent){var e=x.default.createEvent("HTMLEvents");return e.initEvent("canplay",!0,!0),o.dispatchEvent(e)}},300)),l=!1}),o.addEventListener("canplay",function(){r.style.display="none",clearTimeout(o.canplayTimeout),l=!1}),o.addEventListener("error",function(e){i._handleError(e,i.media,i.node),r.style.display="none",s.style.display="none",l=!0}),o.addEventListener("loadedmetadata",function(){i.controlsEnabled||i.enableControls()}),o.addEventListener("keydown",function(e){i.onkeydown(t,o,e),l=!1})}}},{key:"buildkeyboard",value:function(o,e,t,i){var r=this;r.getElement(r.container).addEventListener("keydown",function(){r.keyboardAction=!0}),r.globalKeydownCallback=function(e){var t=x.default.activeElement.closest("."+r.options.classPrefix+"container"),n=r.media.closest("."+r.options.classPrefix+"container");return r.hasFocus=!(!t||!n||t.id!==n.id),r.onkeydown(o,i,e)},r.globalClickCallback=function(e){r.hasFocus=!!e.target.closest("."+r.options.classPrefix+"container")},r.globalBind("keydown",r.globalKeydownCallback),r.globalBind("click",r.globalClickCallback)}},{key:"onkeydown",value:function(e,t,n){if(e.hasFocus&&e.options.enableKeyboard)for(var o=0,i=e.options.keyActions.length;oimg");(e&&l.node.setAttribute("poster",e.src),delete l.node.autoplay,l.node.setAttribute("src",""),""!==l.media.canPlayType((0,p.getTypeFromFile)(u))&&l.node.setAttribute("src",u),d&&-1t[0]||n[0]===t[0]&&n[1]>t[1]||n[0]===t[0]&&n[1]===t[1]&&n[2]>=t[2]},addPlugin:function(e,t,n,o,i){r.plugins[e]=r.detectPlugin(t,n,o,i)},detectPlugin:function(e,t,n,o){var i=[0,0,0],r=void 0,a=void 0;if(null!==F.NAV.plugins&&void 0!==F.NAV.plugins&&"object"===d(F.NAV.plugins[e])){if((r=F.NAV.plugins[e].description)&&(void 0===F.NAV.mimeTypes||!F.NAV.mimeTypes[t]||F.NAV.mimeTypes[t].enabledPlugin))for(var s=0,l=(i=r.replace(e,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".")).length;s'+N.default.t("mejs.install-flash")+"
"}else x=['id="__'+r.id+'"','name="__'+r.id+'"','play="true"','loop="false"','quality="high"','bgcolor="#000000"','wmode="transparent"','allowScriptAccess="'+r.options.shimScriptAccess+'"','allowFullScreen="true"','type="application/x-shockwave-flash"','pluginspage="//www.macromedia.com/go/getflashplayer"','src="'+r.options.pluginPath+r.options.filename+'"','flashvars="'+y.join("&")+'"'],E?(x.push('width="'+S+'"'),x.push('height="'+b+'"')):x.push('style="position: fixed; left: -9999em; top: -9999em;"'),r.flashWrapper.innerHTML="";if(r.flashNode=r.flashWrapper.lastChild,r.hide=function(){o=!1,E&&(r.flashNode.style.display="none")},r.show=function(){o=!0,E&&(r.flashNode.style.display="")},r.setSize=function(e,t){r.flashNode.style.width=e+"px",r.flashNode.style.height=t+"px",null!==r.flashApi&&"function"==typeof r.flashApi.fire_setSize&&r.flashApi.fire_setSize(e,t)},r.destroy=function(){r.flashNode.remove()},n&&0":">",'"':"""};return e.replace(/[&<>"]/g,function(e){return t[e]})}function s(o,i){var r=this,a=arguments,s=2x',t.firstChild.href}function d(e){var t=1'+mejsL10n.strings["mejs.download-file"]+""},n(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").filter(function(){return!n(this).parent().hasClass("mejs-mediaelement")}).mediaelementplayer(e)}}},n(e.wp.mediaelement.initialize)}(window,jQuery);
(function ($){
$(function (){
$('.sc_socials_share a:not(.inited)').each(function (idx){
var el=$(this).addClass('inited'),
cnt=el.data('count'),
u=el.data('url'),
z=el.data("zero-counter");
if(!u) u=location.href;
if(!z) z=1;
if(cnt=="delicious"){
function delicious_count(url){
var shares;
$.getJSON(JUNOTOYS_STORAGE['site_protocol']+'://feeds.delicious.com/v2/json/urlinfo/data?callback=?&url=' + url, function (data){
shares=data[0] ? data[0].total_posts:0;
if(shares > 0||z==1) el.after('' + shares + ' ')
});
}
delicious_count(u);
}else if(cnt=="facebook"){
function fb_count(url){
var shares;
$.getJSON(JUNOTOYS_STORAGE['site_protocol']+'://graph.facebook.com/?callback=?&ids=' + url, function (data){
shares=data[url]&&data[url].shares ? data[url].shares:0;
if(shares > 0||z==1) el.after('' + shares + ' ')
})
}
fb_count(u);
}else if(cnt=="linkedin"){
function lnkd_count(url){
var shares;
$.getJSON(JUNOTOYS_STORAGE['site_protocol']+'://www.linkedin.com/countserv/count/share?callback=?&url=' + url, function (data){
shares=data.count;
if(shares > 0||z==1) el.after('' + shares + ' ')
})
}
lnkd_count(u);
}else if(cnt=="mail"){
function mail_count(url){
var shares;
$.getJSON(JUNOTOYS_STORAGE['site_protocol']+'://connect.mail.ru/share_count?callback=1&func=?&url_list=' + url, function (data){
shares=data.hasOwnProperty(url) ? data[url].shares:0;
if(shares > 0||z==1) el.after('' + shares + ' ')
})
}
mail_count(u);
}else if(cnt=="odnoklassniki"){
function odkl_count(url){
var shares;
$.getScript(JUNOTOYS_STORAGE['site_protocol']+'://www.odnoklassniki.ru/dk?st.cmd=extLike&uid=' + idx + '&ref=' + url);
if(!window.ODKL) window.ODKL={};
window.ODKL.updateCount=function (idx, number){
shares=number;
if(shares > 0||z==1) el.after('' + shares + ' ')
}}
odkl_count(u);
}else if(cnt=="pinterest"){
function pin_count(url){
var shares;
$.getJSON(JUNOTOYS_STORAGE['site_protocol']+'://api.pinterest.com/v1/urls/count.json?callback=?&url=' + url, function (data){
shares=data.count;
if(shares > 0||z==1) el.after('' + shares + ' ')
})
}
pin_count(u);
}else if(cnt=="twitter"){
function twi_count(url){
var shares;
$.getJSON(JUNOTOYS_STORAGE['site_protocol']+'://urls.api.twitter.com/1/urls/count.json?callback=?&url=' + url, function (data){
shares=data.count;
if(shares > 0||z==1) el.after('' + shares + ' ')
})
}
twi_count(u);
}else if(cnt=="vk"||cnt=="vk2"){
function vk_count(url){
var shares;
$.getScript(JUNOTOYS_STORAGE['site_protocol']+'://vk.com/share.php?act=count&index=' + idx + '&url=' + url);
if(!window.VK) window.VK={};
window.VK.Share={
count: function (idx, number){
shares=number;
if(shares > 0||z==1) el.after('' + shares + ' ')
}}
}
vk_count(u);
}else if(cnt=="ya"){
function ya_count(url){
if(!window.Ya) window.Ya={};
window.Ya.Share={
showCounter: function (number){
window.yaShares=number
}};
$.getScript(JUNOTOYS_STORAGE['site_protocol']+'://wow.ya.ru/ajax/share-counter.xml?url=' + url, function (){
var shares=window.yaShares;
if(shares > 0||z==1) el.after('' + shares + ' ')
})
}
ya_count(u);
}})
})
})(jQuery);
!function(p,u,d){"use strict";function t(){p(d).trigger("joinchat:starting");var t,o,e=1e3*joinchat_obj.settings.button_delay,n=1e3*joinchat_obj.settings.message_delay,i=!!joinchat_obj.settings.message_hash,a=!!joinchat_obj.$(".joinchat__box").length,s=parseInt(joinchat_obj.store.getItem("joinchat_views")||1)>=joinchat_obj.settings.message_views,h=-1!==(joinchat_obj.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean).indexOf(joinchat_obj.settings.message_hash||"none");function c(){clearTimeout(o),joinchat_obj.chatbox_show()}function j(){joinchat_obj.save_hash(),joinchat_obj.chatbox_hide()}var _,r,b,l="joinchat--show";function g(){var t=(d.activeElement.type||"").toLowerCase();0<=["date","datetime","email","month","number","password","search","tel","text","textarea","time","url","week"].indexOf(t)?joinchat_obj.chatbox?(joinchat_obj.chatbox_hide(),setTimeout(function(){joinchat_obj.$div.removeClass("joinchat--show")},400)):joinchat_obj.$div.removeClass("joinchat--show"):joinchat_obj.$div.addClass("joinchat--show")}h||i&&n&&!joinchat_obj.settings.message_badge&&s||(l+=" joinchat--tooltip"),setTimeout(function(){joinchat_obj.$div.addClass(l)},e),i&&!h&&n&&(joinchat_obj.settings.message_badge?o=setTimeout(function(){joinchat_obj.$(".joinchat__badge").addClass("joinchat__badge--in")},e+n):s&&(o=setTimeout(c,e+n))),a&&!joinchat_obj.is_mobile&&joinchat_obj.$(".joinchat__button").on("mouseenter",function(){t=setTimeout(c,1500)}).on("mouseleave",function(){clearTimeout(t)}),joinchat_obj.$(".joinchat__button").on("click",function(){a&&!joinchat_obj.chatbox?c():(j(),joinchat_obj.open_whatsapp())}),joinchat_obj.$(".joinchat__close").on("click",j),joinchat_obj.$(".joinchat__box__scroll").on("mousewheel DOMMouseScroll",function(t){t.preventDefault();t=t.originalEvent.wheelDelta||-t.originalEvent.detail;this.scrollTop+=30*(t<0?1:-1)}),joinchat_obj.is_mobile&&(p(d).on("focus blur","input, textarea",function(t){p(t.target).closest(joinchat_obj.$div).length||(clearTimeout(_),_=setTimeout(g,200))}),p(u).on("resize",function(){clearTimeout(r),r=setTimeout(function(){joinchat_obj.$div[0].style.setProperty("--vh",window.innerHeight+"px")},200)}).trigger("resize")),p(d).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),!a||p(this).is('.joinchat_app, a[href="#whatsapp"]')?joinchat_obj.open_whatsapp():c()}),p(d).on("click",".joinchat_close",function(t){t.preventDefault(),joinchat_obj.chatbox_hide()}),a&&"IntersectionObserver"in u&&(0<(n=p(".joinchat_show, .joinchat_force_show")).length&&(b=new IntersectionObserver(function(t){p.each(t,function(){if(0 0){
container.find(".sc_accordion:not(.inited)").each(function (){
"use strict";
var init=jQuery(this).data('active');
if(isNaN(init)) init=0;
else init=Math.max(0, init);
jQuery(this)
.addClass('inited')
.accordion({
active: init,
heightStyle: "content",
header: "> .sc_accordion_item > .sc_accordion_title",
create: function (event, ui){
"use strict";
junotoys_sc_init(ui.panel);
if(window.junotoys_init_hidden_elements) junotoys_init_hidden_elements(ui.panel);
ui.header.each(function (){
"use strict";
jQuery(this).parent().addClass('sc_active');
});
},
activate: function (event, ui){
"use strict";
junotoys_sc_init(ui.newPanel);
if(window.junotoys_init_hidden_elements) junotoys_init_hidden_elements(ui.newPanel);
ui.newHeader.each(function (){
"use strict";
jQuery(this).parent().addClass('sc_active');
});
ui.oldHeader.each(function (){
"use strict";
jQuery(this).parent().removeClass('sc_active');
});
console.log('!!!!!');
if(!jQuery.isEmptyObject(ui.newHeader.offset())){
var topOffset=50;
if(jQuery('body').hasClass('top_panel_fixed')){
topOffset +=parseInt(jQuery('header').height());
}
jQuery('html:not(:animated), body:not(:animated)').animate({ scrollTop: ui.newHeader.offset().top - topOffset }, 'slow');
}}
});
});
}
if(container.find('.sc_blogger.layout_polaroid .photostack:not(.inited)').length > 0){
container.find(".sc_blogger.layout_polaroid .photostack:not(.inited)").each(function (){
"use strict";
var obj=jQuery(this);
var id=obj.attr('id');
if(id==undefined){
id='photostack_'+Math.random();
id=id.replace('.', '');
obj.attr('id', id);
}
setTimeout(function(){
"use strict";
obj.addClass('inited').parent().height("auto");
new Photostack(obj.get(0), {
callback: function(item){
}});
}, 10);
});
}
if(container.find('.sc_blogger .sc_scroll_horizontal .sc_scroll_wrapper:not(.inited)').length > 0){
container.find(".sc_blogger .sc_scroll_horizontal .sc_scroll_wrapper:not(.inited)").each(function (){
"use strict";
var obj=jQuery(this);
var width=0;
obj.find('.isotope_item').each(function(){
"use strict";
width +=jQuery(this).outerWidth();
});
obj.addClass('inited').width(width);
});
}
if(container.find('.sc_form:not(.inited) form').length > 0){
container.find(".sc_form:not(.inited) form").each(function(){
"use strict";
jQuery(this).addClass('inited');
jQuery(this).submit(function(e){
"use strict";
junotoys_sc_form_validate(jQuery(this));
e.preventDefault();
return false;
});
if(jQuery(this).find('.js__datepicker').length > 0){
jQuery(this).find('.js__datepicker').pickadate({
onOpen: function(){
"use strict";
jQuery('pre').css('overflow', 'hidden');
},
onClose: function(){
"use strict";
jQuery('pre').css('overflow', '');
},
monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec' ],
showMonthsShort: true,
format: 'dd.mm.yyyy',
formatSubmit: 'yyyy-mm-dd',
min: true
});
}
if(jQuery(this).find('.js__timepicker').length > 0){
jQuery(this).find('.js__timepicker').pickatime();
}});
}
if(container.find('.sc_countdown:not(.inited)').length > 0){
container.find('.sc_countdown:not(.inited)')
.each(function (){
"use strict";
jQuery(this).addClass('inited');
var id=jQuery(this).attr('id');
var curDate=new Date();
var curDateTimeStr=curDate.getFullYear()+'-'+(curDate.getMonth()<9 ? '0':'')+(curDate.getMonth()+1)+'-'+(curDate.getDate()<10 ? '0':'')+curDate.getDate()
+' '+(curDate.getHours()<10 ? '0':'')+curDate.getHours()+':'+(curDate.getMinutes()<10 ? '0':'')+curDate.getMinutes()+':'+(curDate.getSeconds()<10 ? '0':'')+curDate.getSeconds();
var interval=1;
var endDateStr=jQuery(this).data('date');
var endDateParts=endDateStr.split('-');
var endTimeStr=jQuery(this).data('time');
var endTimeParts=endTimeStr.split(':');
if(endTimeParts.length < 3) endTimeParts[2]='00';
var endDateTimeStr=endDateStr+' '+endTimeStr;
if(curDateTimeStr < endDateTimeStr){
jQuery(this).find('.sc_countdown_placeholder').countdown({
until: new Date(endDateParts[0], endDateParts[1]-1, endDateParts[2], endTimeParts[0], endTimeParts[1], endTimeParts[2]),
tickInterval: interval,
onTick: junotoys_countdown
});
}else{
jQuery(this).find('.sc_countdown_placeholder').countdown({
since: new Date(endDateParts[0], endDateParts[1]-1, endDateParts[2], endTimeParts[0], endTimeParts[1], endTimeParts[2]),
tickInterval: interval,
onTick: junotoys_countdown
});
}});
}
if(container.find('.sc_emailer:not(.inited)').length > 0){
container.find(".sc_emailer:not(.inited)")
.addClass('inited')
.on('click', '.sc_emailer_button', function(e){
"use strict";
var form=jQuery(this).parents('form');
var parent=jQuery(this).parents('.sc_emailer');
if(parent.hasClass('sc_emailer_opened')){
if(form.length>0&&form.find('input').val()!=''){
var group=jQuery(this).data('group');
var email=form.find('input').val();
var regexp=new RegExp(JUNOTOYS_STORAGE['email_mask']);
if(!regexp.test(email)){
form.find('input').get(0).focus();
junotoys_message_warning(JUNOTOYS_STORAGE['strings']['email_not_valid']);
}else{
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'emailer_submit',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
group: group,
email: email
}).done(function(response){
"use strict";
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: JUNOTOYS_STORAGE['ajax_error'] };
console.log(response);
}
if(rez.error===''){
junotoys_message_info(JUNOTOYS_STORAGE['strings']['email_confirm'].replace('%s', email));
form.find('input').val('');
}else{
junotoys_message_warning(rez.error);
}});
}} else
form.get(0).submit();
}else{
parent.addClass('sc_emailer_opened');
}
e.preventDefault();
return false;
});
}
if(container.find('.sc_googlemap:not(.inited)').length > 0){
container.find('.sc_googlemap:not(.inited)')
.each(function (){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var map=jQuery(this).addClass('inited');
var map_id=map.attr('id');
var map_zoom=map.data('zoom');
var map_style=map.data('style');
var map_markers=[];
map.find('.sc_googlemap_marker').each(function(){
"use strict";
var marker=jQuery(this);
map_markers.push({
point: marker.data('point'),
address: marker.data('address'),
latlng: marker.data('latlng'),
description: marker.data('description'),
title: marker.data('title')
});
});
junotoys_googlemap_init(jQuery('#'+map_id).get(0), {style: map_style, zoom: map_zoom, markers: map_markers});
});
}
if(container.find('.sc_infobox.sc_infobox_closeable:not(.inited)').length > 0){
container.find('.sc_infobox.sc_infobox_closeable:not(.inited)')
.addClass('inited')
.on('click', function (e){
"use strict";
jQuery(this).slideUp();
e.preventDefault();
return false;
});
}
if(container.find('.sc_matches:not(.inited)').length > 0){
container.find('.sc_matches:not(.inited)')
.each(function (){
"use strict";
jQuery(this).find('.sc_matches_next .sc_matches_list .sc_match').on('click', function (){
"use strict";
jQuery(this).parents('.sc_matches').find('.sc_matches_current .sc_match').hide();
var item=jQuery(this).data('item');
jQuery(item).fadeIn();
});
});
}
if(container.find('.sc_players_table:not(.inited)').length > 0){
container.find('.sc_players_table:not(.inited)')
.addClass('inited')
.on('click', '.sort', function (e){
"use strict";
var table=jQuery(this).parents('.sc_players_table');
var id=jQuery(table).attr('id')
var sort=jQuery(table).data('sort')=='asc' ? 'desc':'asc';
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'sort_by_points',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
sort: sort,
table: JUNOTOYS_STORAGE['ajax_' + id]
}).done(function(response){
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: JUNOTOYS_STORAGE['ajax_error'] };
console.log(response);
}
if(rez.error===''){
table
.data('sort', sort)
.find('.sc_table')
.after(rez.data)
.remove();
junotoys_select_players_category(jQuery(table).find('.sc_players_table_category select'));
}});
e.preventDefault();
return false;
});
}
if(container.find('.sc_players_table_category:not(.inited)').length > 0){
container.find('.sc_players_table_category:not(.inited)')
.addClass('inited')
.on('change', function (){
"use strict";
junotoys_select_players_category(jQuery(this));
});
}
if(container.find('.sc_popup_link:not(.inited)').length > 0){
container.find('.sc_popup_link:not(.inited)').each(function(){
var popup_id=jQuery(this).attr('href');
jQuery(this)
.addClass('inited')
.magnificPopup({
type: 'inline',
removalDelay: 500,
midClick: true,
callbacks: {
beforeOpen: function (){
this.st.mainClass='mfp-zoom-in';
},
open: function(){
"use strict";
junotoys_sc_init(jQuery(popup_id));
junotoys_resize_actions();
if(window.junotoys_init_hidden_elements) junotoys_init_hidden_elements(jQuery(popup_id));
},
close: function(){}}
});
});
}
if(container.find('.sc_recent_news_header_category_item_more:not(.inited)').length > 0){
container.find('.sc_recent_news_header_category_item_more:not(.inited)').each(function(){
"use strict";
jQuery(this)
.addClass('inited')
.on('click', function(e){
"use strict";
jQuery(this).toggleClass('opened').find('.sc_recent_news_header_more_categories').slideToggle();
e.preventDefault();
return false;
});
});
}
if(container.find('.search_wrap:not(.inited)').length > 0){
container.find('.search_wrap:not(.inited)').each(function(){
"use strict";
jQuery(this)
.addClass('inited')
.on('click', '.search_submit', function(e){
"use strict";
var search_wrap=jQuery(this).parents('.search_wrap');
if(!search_wrap.hasClass('search_state_fixed')){
if(search_wrap.hasClass('search_state_opened')){
if(search_wrap.find('.search_field').val()!='')
search_wrap.find('form').get(0).submit();
else
search_wrap.removeClass('search_state_opened').addClass('search_state_closed').find('.search_results').fadeOut();
} else
search_wrap.removeClass('search_state_closed').addClass('search_state_opened').find('.search_field').get(0).focus();
}else{
if(search_wrap.find('.search_field').val()!='')
search_wrap.find('form').get(0).submit();
else {
search_wrap.find('.search_field').val('');
search_wrap.find('.search_results').fadeOut();
}}
e.preventDefault();
return false;
})
.on('click', '.search_close', function(e){
"use strict";
jQuery(this).parents('.search_wrap').removeClass('search_state_opened').addClass('search_state_closed').find('.search_results').fadeOut();
e.preventDefault();
return false;
})
.on('click', '.search_results_close', function(e){
"use strict";
jQuery(this).parent().fadeOut();
e.preventDefault();
return false;
})
.on('click', '.search_more', function(e){
"use strict";
if(jQuery(this).parents('.search_wrap').find('.search_field').val()!='')
jQuery(this).parents('.search_wrap').find('form').get(0).submit();
e.preventDefault();
return false;
})
.on('blur', '.search_field', function(e){
if(jQuery(this).val()=='')
jQuery(this).parents('.search_wrap').removeClass('search_state_opened').addClass('search_state_closed').find('.search_results').fadeOut();
});
if(jQuery(this).hasClass('search_ajax')){
var ajax_timer=null;
jQuery(this).find('.search_field').keyup(function(e){
"use strict";
var search_field=jQuery(this);
var s=search_field.val();
if(ajax_timer){
clearTimeout(ajax_timer);
ajax_timer=null;
}
if(s.length >=JUNOTOYS_STORAGE['ajax_search_min_length']){
ajax_timer=setTimeout(function(){
"use strict";
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'ajax_search',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
text: s
}).done(function(response){
"use strict";
clearTimeout(ajax_timer);
ajax_timer=null;
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: JUNOTOYS_STORAGE['ajax_error'] };
console.log(response);
}
if(rez.error===''){
search_field.parents('.search_ajax').find('.search_results_content').empty().append(rez.data);
search_field.parents('.search_ajax').find('.search_results').fadeIn();
}else{
junotoys_message_warning(JUNOTOYS_STORAGE['strings']['search_error']);
}});
}, JUNOTOYS_STORAGE['ajax_search_delay']);
}});
}});
}
if(container.find('.sc_pan:not(.inited_pan)').length > 0){
container.find('.sc_pan:not(.inited_pan)')
.each(function (){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
var pan=jQuery(this).addClass('inited_pan');
var cont=pan.parent();
cont.mousemove(function(e){
"use strict";
var anim={};
var tm=0;
var pw=pan.width(), ph=pan.height();
var cw=cont.width(), ch=cont.height();
var coff=cont.offset();
if(pan.hasClass('sc_pan_vertical'))
pan.css('top', -Math.floor((e.pageY - coff.top) / ch * (ph-ch)));
if(pan.hasClass('sc_pan_horizontal'))
pan.css('left', -Math.floor((e.pageX - coff.left) / cw * (pw-cw)));
});
cont.mouseout(function(e){
"use strict";
pan.css({'left': 0, 'top': 0});
});
});
}
if(container.find('.sc_scroll:not(.inited)').length > 0){
container.find('.sc_scroll:not(.inited)')
.each(function (){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
JUNOTOYS_STORAGE['scroll_init_counter']=0;
junotoys_sc_init_scroll_area(jQuery(this));
});
}
if(container.find('.sc_slider_swiper:not(.inited)').length > 0){
container.find('.sc_slider_swiper:not(.inited)')
.each(function (){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
jQuery(this).addClass('inited');
junotoys_sc_slider_autoheight(jQuery(this));
if(jQuery(this).parents('.sc_slider_pagination_area').length > 0){
jQuery(this).parents('.sc_slider_pagination_area').find('.sc_slider_pagination .post_item').eq(0).addClass('active');
}
var id=jQuery(this).attr('id');
if(id==undefined){
id='swiper_'+Math.random();
id=id.replace('.', '');
jQuery(this).attr('id', id);
}
jQuery(this).addClass(id);
jQuery(this).find('.slides .swiper-slide').css('position', 'relative');
var width=jQuery(this).width();
if(width==0) width=jQuery(this).parent().width();
var spv=jQuery(this).data('slides-per-view');
if(spv==undefined) spv=1;
var min_width=jQuery(this).data('slides-min-width');
if(min_width==undefined) min_width=50;
if(width / spv < min_width) spv=Math.max(1, Math.floor(width / min_width));
var space=jQuery(this).data('slides-space');
if(space==undefined) space=0;
if(JUNOTOYS_STORAGE['swipers']===undefined) JUNOTOYS_STORAGE['swipers']={};
JUNOTOYS_STORAGE['swipers'][id]=new Swiper('.'+id, {
calculateHeight: !jQuery(this).hasClass('sc_slider_height_fixed'),
resizeReInit: true,
autoResize: true,
loop: true,
grabCursor: true,
nextButton: jQuery(this).hasClass('sc_slider_controls') ? '#'+id+' .sc_slider_next':false,
prevButton: jQuery(this).hasClass('sc_slider_controls') ? '#'+id+' .sc_slider_prev':false,
pagination: jQuery(this).hasClass('sc_slider_pagination') ? '#'+id+' .sc_slider_pagination_wrap':false,
paginationClickable: true,
autoplay: jQuery(this).hasClass('sc_slider_noautoplay') ? false:(isNaN(jQuery(this).data('interval')) ? 7000:jQuery(this).data('interval')),
autoplayDisableOnInteraction: false,
initialSlide: 0,
slidesPerView: spv,
loopedSlides: spv,
spaceBetween: space,
speed: 600,
onFirstInit: function (slider){
"use strict";
var cont=jQuery(slider.container);
if(!cont.hasClass('sc_slider_height_auto')) return;
var li=cont.find('.swiper-slide').eq(1);
var h=li.data('height_auto');
if(h > 0){
var pt=parseInt(li.css('paddingTop')), pb=parseInt(li.css('paddingBottom'));
li.height(h);
cont.height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb));
cont.find('.swiper-wrapper').height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb));
}},
onSlideChangeStart: function (slider){
"use strict";
var cont=jQuery(slider.container);
if(!cont.hasClass('sc_slider_height_auto')) return;
var idx=slider.activeIndex;
var li=cont.find('.swiper-slide').eq(idx);
var h=li.data('height_auto');
if(h > 0){
var pt=parseInt(li.css('paddingTop')), pb=parseInt(li.css('paddingBottom'));
li.height(h);
cont.height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb));
cont.find('.swiper-wrapper').height(h + (isNaN(pt) ? 0:pt) + (isNaN(pb) ? 0:pb));
}},
onSlideChangeEnd: function (slider, dir){
"use strict";
var cont=jQuery(slider.container);
if(cont.parents('.sc_slider_pagination_area').length > 0){
var li=cont.parents('.sc_slider_pagination_area').find('.sc_slider_pagination .post_item');
var idx=slider.activeIndex > li.length ? 0:slider.activeIndex-1;
junotoys_sc_change_active_pagination_in_slider(cont, idx);
}}
});
jQuery(this).data('settings', {mode: 'horizontal'});
var curSlide=jQuery(this).find('.slides').data('current-slide');
if(curSlide > 0)
JUNOTOYS_STORAGE['swipers'][id].slideTo(curSlide-1);
junotoys_sc_prepare_slider_navi(jQuery(this));
});
junotoys_sc_sliders_resize();
}
if(container.find('.sc_skills_item:not(.inited)').length > 0){
junotoys_sc_init_skills(container);
jQuery(window).scroll(function (){ junotoys_sc_init_skills(container); });
}
if(container.find('.sc_skills_arc:not(.inited)').length > 0){
junotoys_sc_init_skills_arc(container);
jQuery(window).scroll(function (){ junotoys_sc_init_skills_arc(container); });
}
if(container.find('.sc_tabs:not(.inited):not(.no_jquery_ui),.tabs_area:not(.inited)').length > 0){
container.find('.sc_tabs:not(.inited):not(.no_jquery_ui),.tabs_area:not(.inited)').each(function (){
"use strict";
var init=jQuery(this).data('active');
if(isNaN(init)) init=0;
else init=Math.max(0, init);
jQuery(this)
.addClass('inited')
.tabs({
active: init,
show: {
effect: 'fadeIn',
duration: 300
},
hide: {
effect: 'fadeOut',
duration: 300
},
create: function (event, ui){
"use strict";
junotoys_sc_init(ui.panel);
if(window.junotoys_init_hidden_elements) junotoys_init_hidden_elements(ui.panel);
},
activate: function (event, ui){
"use strict";
junotoys_sc_init(ui.newPanel);
if(window.junotoys_init_hidden_elements) junotoys_init_hidden_elements(ui.newPanel);
}});
});
}
if(container.find('.sc_tabs.no_jquery_ui:not(.inited)').length > 0){
container.find('.sc_tabs.no_jquery_ui:not(.inited)').each(function (){
"use strict";
jQuery(this)
.addClass('inited')
.on('click', '.sc_tabs_titles li a', function(e){
"use strict";
if(!jQuery(this).parent().hasClass('sc_tabs_active')){
var id_act=jQuery(this).parent().siblings('.sc_tabs_active').find('a').attr('href');
var id=jQuery(this).attr('href');
jQuery(this).parent().addClass('sc_tabs_active').siblings().removeClass('sc_tabs_active');
jQuery(id_act).fadeOut(function(){
"use strict";
jQuery(id).fadeIn(function(){
"use strict";
junotoys_sc_init(jQuery(this));
if(window.junotoys_init_hidden_elements) junotoys_init_hidden_elements(jQuery(this));
});
});
}
e.preventDefault();
return false;
});
jQuery(this).find('.sc_tabs_titles li').eq(0).addClass('sc_tabs_active');
jQuery(this).find('.sc_tabs_content').eq(0).fadeIn(function(){
"use strict";
junotoys_sc_init(jQuery(this));
if(window.junotoys_init_hidden_elements) junotoys_init_hidden_elements(jQuery(this));
});
});
}
if(container.find('.sc_toggles .sc_toggles_title:not(.inited)').length > 0){
container.find('.sc_toggles .sc_toggles_title:not(.inited)')
.addClass('inited')
.on('click', function (){
"use strict";
jQuery(this).toggleClass('ui-state-active').parent().toggleClass('sc_active');
jQuery(this).parent().find('.sc_toggles_content').slideToggle(300, function (){
"use strict";
junotoys_sc_init(jQuery(this).parent().find('.sc_toggles_content'));
if(window.junotoys_init_hidden_elements) junotoys_init_hidden_elements(jQuery(this).parent().find('.sc_toggles_content'));
});
});
}
if(container.find('.sc_zoom:not(.inited)').length > 0){
container.find('.sc_zoom:not(.inited)')
.each(function (){
"use strict";
if(jQuery(this).parents('div:hidden,article:hidden').length > 0) return;
jQuery(this).addClass('inited');
jQuery(this).find('img').elevateZoom({
zoomType: "lens",
lensShape: "round",
lensSize: 200,
lensBorderSize: 4,
lensBorderColour: '#ccc'
});
});
}}
function junotoys_sc_init_scroll_area(obj){
"use strict";
if(!junotoys_check_images_complete(obj)&&JUNOTOYS_STORAGE['scroll_init_counter']++ < 30){
setTimeout(function(){ junotoys_sc_init_scroll_area(obj); }, 200);
return;
}
obj.addClass('inited');
var id=obj.attr('id');
if(id==undefined){
id='scroll_'+Math.random();
id=id.replace('.', '');
obj.attr('id', id);
}
obj.addClass(id);
var parent_obj=obj.parent();
var parent_id=parent_obj.attr('id');
if(parent_id==undefined){
parent_id='scroll_wrap_'+Math.random();
parent_id=parent_id.replace('.', '');
parent_obj.attr('id', parent_id);
}
parent_obj.addClass(parent_id);
var bar=obj.find('#'+id+'_bar');
if(bar.length > 0&&!bar.hasClass(id+'_bar')){
bar.addClass(id+'_bar');
}
if(obj.hasClass('sc_scroll_horizontal')){
obj.find('.sc_scroll_wrapper > .sc_scroll_slide').css('width', 'auto');
obj.find('.sc_scroll_wrapper').css('width', obj.find('.sc_scroll_wrapper > .sc_scroll_slide').width()+10);
obj.find('.sc_scroll_wrapper > .sc_scroll_slide').css('width', '100%')
}
if(JUNOTOYS_STORAGE['swipers']===undefined) JUNOTOYS_STORAGE['swipers']={};
JUNOTOYS_STORAGE['swipers'][id]=new Swiper('.'+id, {
calculateHeight: false,
resizeReInit: true,
autoResize: true,
freeMode: true,
freeModeFluid: true,
grabCursor: true,
mode: obj.hasClass('sc_scroll_vertical') ? 'vertical':'horizontal',
direction: obj.hasClass('sc_scroll_vertical') ? 'vertical':'horizontal',
slidesPerView: obj.hasClass('sc_scroll') ? 'auto':1,
nextButton: parent_obj.hasClass('sc_scroll_controls') ? '#'+parent_id+' .sc_scroll_next':false,
prevButton: parent_obj.hasClass('sc_scroll_controls') ? '#'+parent_id+' .sc_scroll_prev':false,
scrollbar: '.'+id+'_bar',
scrollbarHide: true,
})
obj.data('settings', {mode: 'horizontal'});
}
function junotoys_sc_prepare_slider_navi(slider){
"use strict";
var navi=null;
if(false){
navi=slider.find('> .sc_slider_controls_wrap, > .sc_scroll_controls_wrap');
if(navi.length==0) navi=slider.siblings('.sc_slider_controls_wrap,.sc_scroll_controls_wrap');
if(navi.length > 0){
navi.on('click', '.sc_slider_prev,.sc_scroll_prev', function(e){
var swiper=jQuery(this).parents('.swiper-slider-container');
if(swiper.length==0) swiper=jQuery(this).parents('.sc_slider_controls_wrap,.sc_scroll_controls_wrap').siblings('.swiper-slider-container');
var id=swiper.attr('id');
JUNOTOYS_STORAGE['swipers'][id].slidePrev();
e.preventDefault();
return false;
})
.on('click', '.sc_slider_next,.sc_scroll_next', function(e){
var swiper=jQuery(this).parents('.swiper-slider-container');
if(swiper.length==0) swiper=jQuery(this).parents('.sc_slider_controls_wrap,.sc_scroll_controls_wrap').siblings('.swiper-slider-container');
var id=swiper.attr('id');
JUNOTOYS_STORAGE['swipers'][id].slideNext();
e.preventDefault();
return false;
});
}}
navi=slider.siblings('.sc_slider_pagination');
if(navi.length > 0){
navi.on('click', '.post_item', function(e){
var swiper=jQuery(this).parents('.sc_slider_pagination_area').find('.swiper-slider-container');
var id=swiper.attr('id');
JUNOTOYS_STORAGE['swipers'][id].slideTo(jQuery(this).index()+1);
e.preventDefault();
return false;
});
}}
function junotoys_sc_change_active_pagination_in_slider(slider, idx){
"use strict";
var pg=slider.parents('.sc_slider_pagination_area').find('.sc_slider_pagination');
if(pg.length==0) return;
pg.find('.post_item').removeClass('active').eq(idx).addClass('active');
var h=pg.height();
var off=pg.find('.active').offset().top - pg.offset().top;
var off2=pg.find('.sc_scroll_wrapper').offset().top - pg.offset().top;
var h2=pg.find('.active').height();
if(off < 0){
pg.find('.sc_scroll_wrapper').css({'transform': 'translate3d(0px, 0px, 0px)', 'transition-duration': '0.3s'});
}else if(h <=off+h2){
pg.find('.sc_scroll_wrapper').css({'transform': 'translate3d(0px, -'+(Math.abs(off2)+off-h/4)+'px, 0px)', 'transition-duration': '0.3s'});
}}
function junotoys_sc_slider_autoheight(slider){
"use strict";
if(slider.hasClass('.sc_slider_height_auto')){
slider.find('.swiper-slide').each(function(){
"use strict";
if(jQuery(this).data('height_auto')==undefined){
jQuery(this).attr('data-height_auto', jQuery(this).height());
}});
}}
function junotoys_sc_sliders_resize(){
"use strict";
var slider=arguments[0]!==undefined ? arguments[0]:'.sc_slider_swiper.inited';
var resize=arguments[1]!==undefined ? arguments[1]:true;
jQuery(slider).each(function(){
"use strict";
var id=jQuery(this).attr('id');
var width=jQuery(this).width();
var last_width=jQuery(this).data('last-width');
if(isNaN(last_width)) last_width=0;
if(last_width==0||last_width!=width){
var spv=jQuery(this).data('slides-per-view');
if(spv==undefined) spv=1;
var min_width=jQuery(this).data('slides-min-width');
if(min_width==undefined) min_width=50;
if(width / spv < min_width) spv=Math.max(1, Math.floor(width / min_width));
jQuery(this).data('last-width', width);
if(JUNOTOYS_STORAGE['swipers'][id].params.slidesPerView!=spv){
JUNOTOYS_STORAGE['swipers'][id].params.slidesPerView=spv;
JUNOTOYS_STORAGE['swipers'][id].params.loopedSlides=spv;
}}
if(resize&&!jQuery(this).hasClass('sc_slider_height_fixed')){
var h=0;
if(jQuery(this).find('.swiper-slide > img').length > 0){
jQuery(this).find('.swiper-slide > img').each(function(){
"use strict";
if(jQuery(this).height() > h) h=jQuery(this).height();
});
jQuery(this).height(h);
}else if(jQuery(this).find('.swiper-slide').css('backgroundImage')!='none'){
h=Math.floor(width/16*9);
jQuery(this).height(h).find('.swiper-slide').height(h);
}}
});
jQuery('.sc_slider_pagination_area').each(function(){
"use strict";
var h=jQuery(this).find('.sc_slider').height();
if(h){
jQuery(this).height(h);
jQuery(this).find('.sc_slider_pagination').height(h);
jQuery(this).find('.sc_slider_pagination .sc_scroll_vertical').height(h);
}});
}
function junotoys_sc_equal_height(){
"use strict";
jQuery('[data-equal-height]').each(function(){
"use strict";
var eh_wrap=jQuery(this);
var eh_items_selector=eh_wrap.data('equal-height');
if(eh_items_selector){
var max_h=0;
var items=[];
var row_y=0;
var i=0;
eh_wrap.find(eh_items_selector).each(function(){
"use strict";
var el=jQuery(this);
el.height('auto');
var el_height=el.height();
var el_offset=el.offset().top;
if(row_y==0) row_y=el_offset;
if(row_y < el_offset){
if(items.length > 0){
if(max_h > 0){
for (i=0; i max_h) max_h=el_height;
items.push(el);
});
if(items.length > 0&&max_h > 0){
for (i=0; i scrollSkills){
skillsItem.addClass('inited');
var skills=skillsItem.parents('.sc_skills').eq(0);
var type=skills.data('type');
var total=(type=='pie'&&skills.hasClass('sc_skills_compact_on')) ? skillsItem.find('.sc_skills_data .pie'):skillsItem.find('.sc_skills_total').eq(0);
var start=parseInt(total.data('start'));
var stop=parseInt(total.data('stop'));
var maximum=parseInt(total.data('max'));
var startPercent=Math.round(start/maximum*100);
var stopPercent=Math.round(stop/maximum*100);
var ed=total.data('ed');
var duration=parseInt(total.data('duration'));
var speed=parseInt(total.data('speed'));
var step=parseInt(total.data('step'));
if(type=='bar'){
var dir=skills.data('dir');
var count=skillsItem.find('.sc_skills_count').eq(0);
if(dir=='horizontal')
count.css('width', startPercent + '%').animate({ width: stopPercent + '%' }, duration);
else if(dir=='vertical')
count.css('height', startPercent + '%').animate({ height: stopPercent + '%' }, duration);
junotoys_sc_animate_skills_counter(start, stop, speed-(dir!='unknown' ? 5:0), step, ed, total);
}else if(type=='counter'){
junotoys_sc_animate_skills_counter(start, stop, speed - 5, step, ed, total);
}else if(type=='pie'){
var steps=parseInt(total.data('steps'));
var bg_color=total.data('bg_color');
var border_color=total.data('border_color');
var cutout=parseInt(total.data('cutout'));
var easing=total.data('easing');
var options={
segmentShowStroke: true,
segmentStrokeColor: border_color,
segmentStrokeWidth: 1,
percentageInnerCutout:cutout,
animationSteps: steps,
animationEasing: easing,
animateRotate: true,
animateScale: false,
};
var pieData=[];
total.each(function(){
"use strict";
var color=jQuery(this).data('color');
var stop=parseInt(jQuery(this).data('stop'));
var stopPercent=Math.round(stop/maximum*100);
pieData.push({
value: stopPercent,
color: color
});
});
if(total.length==1){
junotoys_sc_animate_skills_counter(start, stop, Math.round(1500/steps), step, ed, total);
pieData.push({
value: 100-stopPercent,
color: bg_color
});
}
var canvas=skillsItem.find('canvas');
canvas.attr({width: skillsItem.width(), height: skillsItem.width()}).css({width: skillsItem.width(), height: skillsItem.height()});
new Chart(canvas.get(0).getContext("2d")).Doughnut(pieData, options);
}}
});
}
function junotoys_sc_animate_skills_counter(start, stop, speed, step, ed, total){
"use strict";
start=Math.min(stop, start + step);
total.text(start+ed);
if(start < stop){
setTimeout(function (){
junotoys_sc_animate_skills_counter(start, stop, speed, step, ed, total);
}, speed);
}}
function junotoys_sc_init_skills_arc(container){
"use strict";
if(arguments.length==0) var container=jQuery('body');
container.find('.sc_skills_arc:not(.inited)').each(function (){
var arc=jQuery(this);
arc.addClass('inited');
var items=arc.find('.sc_skills_data .arc');
var canvas=arc.find('.sc_skills_arc_canvas').eq(0);
var legend=arc.find('.sc_skills_legend').eq(0);
var w=Math.round(arc.width() - legend.width());
var c=Math.floor(w/2);
var o={
random: function(l, u){
"use strict";
return Math.floor((Math.random()*(u-l+1))+l);
},
diagram: function(){
"use strict";
var r=Raphael(canvas.attr('id'), w, w),
hover=Math.round(w/2/items.length),
rad=hover,
step=Math.round(((w-20)/2-rad)/items.length),
stroke=Math.round(w/9/items.length),
speed=400;
r.circle(c, c, Math.round(w/2)).attr({ stroke: 'none', fill: JUNOTOYS_STORAGE['theme_bg_color'] ? JUNOTOYS_STORAGE['theme_bg_color']:'#ffffff' });
var title=r.text(c, c, arc.data('caption')).attr({
font: Math.round(rad*0.75)+'px "'+JUNOTOYS_STORAGE['theme_font']+'"',
fill: JUNOTOYS_STORAGE['theme_color'] ? JUNOTOYS_STORAGE['theme_color']:'#909090'
}).toFront();
rad -=Math.round(step/2);
r.customAttributes.arc=function(value, color, rad){
"use strict";
var v=3.6 * value,
alpha=v==360 ? 359.99:v,
rand=o.random(91, 240),
a=(rand-alpha) * Math.PI/180,
b=rand * Math.PI/180,
sx=c + rad * Math.cos(b),
sy=c - rad * Math.sin(b),
x=c + rad * Math.cos(a),
y=c - rad * Math.sin(a),
path=[['M', sx, sy], ['A', rad, rad, 0, +(alpha > 180), 1, x, y]];
return { path: path, stroke: color }}
items.each(function(i){
"use strict";
var t=jQuery(this),
color=t.find('.color').val(),
value=t.find('.percent').val(),
text=t.find('.text').text();
rad +=step;
var z=r.path().attr({ arc: [value, color, rad], 'stroke-width': stroke });
z.mouseover(function(){
"use strict";
this.animate({ 'stroke-width': hover, opacity: .75 }, 1000, 'elastic');
if(Raphael.type!='VML')
this.toFront();
title.stop().animate({ opacity: 0 }, speed, '>', function(){
this.attr({ text: (text ? text + '\n':'') + value + '%' }).animate({ opacity: 1 }, speed, '<');
});
}).mouseout(function(){
"use strict";
this.stop().animate({ 'stroke-width': stroke, opacity: 1 }, speed*4, 'elastic');
title.stop().animate({ opacity: 0 }, speed, '>', function(){
title.attr({ text: arc.data('caption') }).animate({ opacity: 1 }, speed, '<');
});
});
});
}}
o.diagram();
});
}
function junotoys_countdown(dt){
"use strict";
var counter=jQuery(this).parent();
for (var i=3; i=0; ch--){
counter.find('.sc_countdown_item').eq(i-3).find('.sc_countdown_digits span').eq(ch+(i==3&&v.length<3 ? 1:0)).removeClass('hide').text(v.substr(ch, 1));
}}
}
function junotoys_sc_form_validate(form){
"use strict";
var url=form.attr('action');
if(url=='') return false;
form.find('input').removeClass('error_fields_class');
var error=false;
var form_custom=form.data('formtype')=='form_custom';
if(!form_custom){
var rules=[], rule={};
if(form.find('[name="username"]').length > 0){
rule={
field: "username",
max_length: { value: 60, message: JUNOTOYS_STORAGE['strings']['name_long'] }};
if(form.find('[name="username"][aria-required="true"]').length > 0)
rule['min_length']={ value: 1, message: JUNOTOYS_STORAGE['strings']['name_empty'] };
rules.push(rule);
}
if(form.find('[name="email"]').length > 0){
rule={
field: "email",
max_length: { value: 60, message: JUNOTOYS_STORAGE['strings']['email_long'] },
mask: { value: JUNOTOYS_STORAGE['email_mask'], message: JUNOTOYS_STORAGE['strings']['email_not_valid'] }};
if(form.find('[name="email"][aria-required="true"]').length > 0)
rule['min_length']={ value: 7, message: JUNOTOYS_STORAGE['strings']['email_empty'] };
rules.push(rule);
}
if(form.find('[name="subject"]').length > 0){
rule={
field: "subject",
max_length: { value: 100, message: JUNOTOYS_STORAGE['strings']['subject_long'] }};
if(form.find('[name="subject"][aria-required="true"]').length > 0)
rule['min_length']={ value: 1, message: JUNOTOYS_STORAGE['strings']['subject_empty'] };
rules.push(rule);
}
if(form.find('[name="message"]').length > 0){
rule={
field: "message",
max_length: { value: JUNOTOYS_STORAGE['contacts_maxlength'], message: JUNOTOYS_STORAGE['strings']['text_long'] }};
if(form.find('[name="message"][aria-required="true"]').length > 0)
rule['min_length']={ value: 1, message: JUNOTOYS_STORAGE['strings']['text_empty'] };
rules.push(rule);
}
error=junotoys_form_validate(form, {
error_message_show: true,
error_message_time: 4000,
error_message_class: "sc_infobox sc_infobox_style_error",
error_fields_class: "error_fields_class",
exit_after_first_error: false,
rules: rules
});
}
if(!error&&url!='#'){
jQuery.post(url, {
action: "send_form",
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
type: form.data('formtype'),
data: form.serialize()
}).done(function(response){
"use strict";
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: JUNOTOYS_STORAGE['ajax_error'] };
console.log(response);
}
var result=form.find(".result").toggleClass("sc_infobox_style_error", false).toggleClass("sc_infobox_style_success", false);
if(rez.error===''){
form.get(0).reset();
result.addClass("sc_infobox_style_success").html(JUNOTOYS_STORAGE['strings']['send_complete']);
var return_url=form.find('input[name="return_url"]');
if(return_url.length > 0&&return_url.val()!=''){
setTimeout(function(){
"use strict";
window.location.href=return_url.val();
}, 3300);
}}else{
result.addClass("sc_infobox_style_error").html(JUNOTOYS_STORAGE['strings']['send_error'] + ' ' + rez.error);
}
result.fadeIn().delay(3000).fadeOut();
});
}
return !error;
}
function junotoys_select_players_category(sel){
var value=sel.find(':selected').data('cat');
var table=sel.parents('.sc_players_table');
if(value=='all')
jQuery(table).find('.sc_table tr:nth-child(n+2)').show();
else {
jQuery(table).find('.sc_table tr:nth-child(n+2)').hide();
jQuery(table).find('.sc_table tr').each(function(){
var cat=jQuery(this).data('cat');
if(cat!=null&&cat.indexOf(value)!=-1)
jQuery(this).show();
});
}}
function junotoys_menuitems_show_popup(obj){
"use strict";
if(typeof JUNOTOYS_STORAGE['menuitem_load']=='undefined'){
JUNOTOYS_STORAGE['menuitem_load']=false;
JUNOTOYS_STORAGE['menuitems_list']=[];
}else if(JUNOTOYS_STORAGE['menuitem_load']){
return;
}
jQuery('#page_preloader').data('bg-color', jQuery('#page_preloader').css('background-color')).css({display: 'block', opacity: 0, backgroundColor: 'transparent'}).animate({opacity:0.8}, 300);
if(JUNOTOYS_STORAGE['menuitems_list'].length==0){
var menuitems_list_id=obj.parents('.sc_menuitems').attr("id");
JUNOTOYS_STORAGE['menuitems_list']=JUNOTOYS_STORAGE['menuitems'][menuitems_list_id].split(",");
}
var menuitem_id=obj.attr('rel');
JUNOTOYS_STORAGE['menuitem_load']=true;
jQuery.post(JUNOTOYS_STORAGE['ajax_url'], {
action: 'ajax_menuitem',
nonce: JUNOTOYS_STORAGE['ajax_nonce'],
text: menuitem_id
}).done(function(response){
"use strict";
JUNOTOYS_STORAGE['menuitem_load']=false;
var rez={};
try {
rez=JSON.parse(response);
} catch (e){
rez={ error: JUNOTOYS_STORAGE['ajax_error'] + ' ' + response };}
jQuery('#page_preloader').animate({opacity:0}, 500, function(){ jQuery(this).css({display: 'none', backgroundColor: jQuery(this).data('bg-color')});});
if(rez.error===''){
var delay=0;
if(jQuery('.popup_menuitem').length==0){
jQuery('body').append('
');
jQuery('#overlay').fadeIn(500);
}else{
delay=500;
jQuery('.popup_menuitem').fadeOut(delay);
}
setTimeout(function(){
jQuery('.popup_menuitem').html(rez.data);
jQuery('.popup_menuitem .sc_menuitems_wrap').append("");
if(JUNOTOYS_STORAGE['menuitems_list'].length > 1){
var idx=0;
for (var i=0; i